Record Class StructureMetadata
java.lang.Object
java.lang.Record
com.pragma.archetype.domain.model.structure.StructureMetadata
public record StructureMetadata(String architectureType, Map<String,String> adapterPaths, NamingConventions namingConventions, LayerDependencies layerDependencies, List<String> packages, List<String> modules)
extends Record
Metadata describing an architecture's structure and conventions.
Loaded from structure.yml files in template repository.
-
Constructor Summary
ConstructorsConstructorDescriptionStructureMetadata(String architectureType, Map<String, String> adapterPaths, NamingConventions namingConventions, LayerDependencies layerDependencies, List<String> packages, List<String> modules) Creates an instance of aStructureMetadatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theadapterPathsrecord component.Returns the value of thearchitectureTyperecord component.final booleanIndicates whether some other object is "equal to" this one.Gets the list of modules for multi-module architectures.final inthashCode()Returns a hash code value for this object.booleanChecks if this structure has layer dependencies defined.booleanChecks if this structure has naming conventions defined.booleanChecks if this structure supports multiple modules.Returns the value of thelayerDependenciesrecord component.modules()Returns the value of themodulesrecord component.Returns the value of thenamingConventionsrecord component.packages()Returns the value of thepackagesrecord component.resolveAdapterPath(String adapterType, String name) Resolves the path for an adapter based on its type and name.final StringtoString()Returns a string representation of this record class.validate()Validates that all required fields are present.
-
Constructor Details
-
StructureMetadata
public StructureMetadata(String architectureType, Map<String, String> adapterPaths, NamingConventions namingConventions, LayerDependencies layerDependencies, List<String> packages, List<String> modules) Creates an instance of aStructureMetadatarecord class.- Parameters:
architectureType- the value for thearchitectureTyperecord componentadapterPaths- the value for theadapterPathsrecord componentnamingConventions- the value for thenamingConventionsrecord componentlayerDependencies- the value for thelayerDependenciesrecord componentpackages- the value for thepackagesrecord componentmodules- the value for themodulesrecord component
-
-
Method Details
-
resolveAdapterPath
Resolves the path for an adapter based on its type and name.- Parameters:
adapterType- The type of adapter (driven or driving)name- The adapter name- Returns:
- The resolved path with placeholders substituted
-
validate
Validates that all required fields are present.- Returns:
- ValidationResult indicating if metadata is valid
-
hasNamingConventions
public boolean hasNamingConventions()Checks if this structure has naming conventions defined. -
hasLayerDependencies
public boolean hasLayerDependencies()Checks if this structure has layer dependencies defined. -
isMultiModule
public boolean isMultiModule()Checks if this structure supports multiple modules. -
getModules
Gets the list of modules for multi-module architectures. -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
architectureType
Returns the value of thearchitectureTyperecord component.- Returns:
- the value of the
architectureTyperecord component
-
adapterPaths
Returns the value of theadapterPathsrecord component.- Returns:
- the value of the
adapterPathsrecord component
-
namingConventions
Returns the value of thenamingConventionsrecord component.- Returns:
- the value of the
namingConventionsrecord component
-
layerDependencies
Returns the value of thelayerDependenciesrecord component.- Returns:
- the value of the
layerDependenciesrecord component
-
packages
Returns the value of thepackagesrecord component.- Returns:
- the value of the
packagesrecord component
-
modules
Returns the value of themodulesrecord component.- Returns:
- the value of the
modulesrecord component
-