Interface ConfigurationPort

All Known Implementing Classes:
YamlConfigurationAdapter

public interface ConfigurationPort
Output port for reading and writing project configuration. This port abstracts the configuration persistence mechanism.
  • Method Details

    • readConfiguration

      Optional<ProjectConfig> readConfiguration(Path projectPath)
      Reads the project configuration from the specified directory.
      Parameters:
      projectPath - the root directory of the project
      Returns:
      Optional containing the configuration if it exists, empty otherwise
    • writeConfiguration

      void writeConfiguration(Path projectPath, ProjectConfig config)
      Writes the project configuration to the specified directory. Creates a .cleanarch.yml file in the project root.
      Parameters:
      projectPath - the root directory of the project
      config - the configuration to write
    • configurationExists

      boolean configurationExists(Path projectPath)
      Checks if a configuration file exists in the project.
      Parameters:
      projectPath - the root directory of the project
      Returns:
      true if configuration exists, false otherwise
    • deleteConfiguration

      void deleteConfiguration(Path projectPath)
      Deletes the configuration file from the project.
      Parameters:
      projectPath - the root directory of the project
    • readTemplateConfiguration

      TemplateConfig readTemplateConfiguration(Path projectPath)
      Reads template configuration from .cleanarch.yml. Parses the templates section including localPath, branch, mode, and cache properties.
      Parameters:
      projectPath - the root directory of the project
      Returns:
      template configuration or default if not specified