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 Summary
Modifier and TypeMethodDescriptionbooleanconfigurationExists(Path projectPath) Checks if a configuration file exists in the project.voiddeleteConfiguration(Path projectPath) Deletes the configuration file from the project.readConfiguration(Path projectPath) Reads the project configuration from the specified directory.readTemplateConfiguration(Path projectPath) Reads template configuration from .cleanarch.yml.voidwriteConfiguration(Path projectPath, ProjectConfig config) Writes the project configuration to the specified directory.
-
Method Details
-
readConfiguration
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
Writes the project configuration to the specified directory. Creates a .cleanarch.yml file in the project root.- Parameters:
projectPath- the root directory of the projectconfig- the configuration to write
-
configurationExists
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
Deletes the configuration file from the project.- Parameters:
projectPath- the root directory of the project
-
readTemplateConfiguration
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
-