Record Class NamingConventions
java.lang.Object
java.lang.Record
com.pragma.archetype.domain.model.structure.NamingConventions
public record NamingConventions(Map<String,String> suffixes, Map<String,String> prefixes)
extends Record
Naming conventions for components in an architecture.
Defines suffixes and prefixes to apply to component names.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapplyConventions(String componentType, String baseName) Applies naming conventions to a component name.final booleanIndicates whether some other object is "equal to" this one.Gets the prefix for a component type.Gets the suffix for a component type.booleanhasConventionsFor(String componentType) Checks if conventions are defined for a component type.final inthashCode()Returns a hash code value for this object.prefixes()Returns the value of theprefixesrecord component.suffixes()Returns the value of thesuffixesrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
NamingConventions
Creates an instance of aNamingConventionsrecord class.- Parameters:
suffixes- the value for thesuffixesrecord componentprefixes- the value for theprefixesrecord component
-
-
Method Details
-
applyConventions
Applies naming conventions to a component name.- Parameters:
componentType- The type of component (e.g., "useCase", "port", "adapter")baseName- The base name without conventions- Returns:
- The name with conventions applied
-
getSuffix
Gets the suffix for a component type.- Parameters:
componentType- The component type- Returns:
- The suffix, or empty string if not defined
-
getPrefix
Gets the prefix for a component type.- Parameters:
componentType- The component type- Returns:
- The prefix, or empty string if not defined
-
hasConventionsFor
Checks if conventions are defined for a component type. -
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). -
suffixes
Returns the value of thesuffixesrecord component.- Returns:
- the value of the
suffixesrecord component
-
prefixes
Returns the value of theprefixesrecord component.- Returns:
- the value of the
prefixesrecord component
-