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 Details

    • StructureMetadata

      public StructureMetadata(String architectureType, Map<String,String> adapterPaths, NamingConventions namingConventions, LayerDependencies layerDependencies, List<String> packages, List<String> modules)
      Creates an instance of a StructureMetadata record class.
      Parameters:
      architectureType - the value for the architectureType record component
      adapterPaths - the value for the adapterPaths record component
      namingConventions - the value for the namingConventions record component
      layerDependencies - the value for the layerDependencies record component
      packages - the value for the packages record component
      modules - the value for the modules record component
  • Method Details

    • resolveAdapterPath

      public String resolveAdapterPath(String adapterType, String name)
      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

      public ValidationResult 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

      public List<String> getModules()
      Gets the list of modules for multi-module architectures.
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • architectureType

      public String architectureType()
      Returns the value of the architectureType record component.
      Returns:
      the value of the architectureType record component
    • adapterPaths

      public Map<String,String> adapterPaths()
      Returns the value of the adapterPaths record component.
      Returns:
      the value of the adapterPaths record component
    • namingConventions

      public NamingConventions namingConventions()
      Returns the value of the namingConventions record component.
      Returns:
      the value of the namingConventions record component
    • layerDependencies

      public LayerDependencies layerDependencies()
      Returns the value of the layerDependencies record component.
      Returns:
      the value of the layerDependencies record component
    • packages

      public List<String> packages()
      Returns the value of the packages record component.
      Returns:
      the value of the packages record component
    • modules

      public List<String> modules()
      Returns the value of the modules record component.
      Returns:
      the value of the modules record component