Record Class TemplateConfig
java.lang.Object
java.lang.Record
com.pragma.archetype.domain.model.config.TemplateConfig
public record TemplateConfig(TemplateMode mode, String repository, String branch, String version, String localPath, boolean cache)
extends Record
Configuration for template repository.
Supports both production mode (GitHub) and developer mode (local path).
-
Constructor Summary
ConstructorsConstructorDescriptionTemplateConfig(TemplateMode mode, String repository, String branch, String version, String localPath, boolean cache) Creates an instance of aTemplateConfigrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbranch()Returns the value of thebranchrecord component.booleancache()Returns the value of thecacherecord component.static TemplateConfigCreates default production configuration.static TemplateConfigdeveloperConfig(String localPath) Creates developer configuration with local path.static TemplateConfigdeveloperConfig(String repository, String branch) Creates developer configuration with custom repository and branch.final booleanIndicates whether some other object is "equal to" this one.Gets the effective branch to use.final inthashCode()Returns a hash code value for this object.booleanChecks if using local filesystem.booleanChecks if using remote repository.Returns the value of thelocalPathrecord component.mode()Returns the value of themoderecord component.Returns the value of therepositoryrecord component.final StringtoString()Returns a string representation of this record class.version()Returns the value of theversionrecord component.
-
Constructor Details
-
TemplateConfig
public TemplateConfig(TemplateMode mode, String repository, String branch, String version, String localPath, boolean cache) Creates an instance of aTemplateConfigrecord class.- Parameters:
mode- the value for themoderecord componentrepository- the value for therepositoryrecord componentbranch- the value for thebranchrecord componentversion- the value for theversionrecord componentlocalPath- the value for thelocalPathrecord componentcache- the value for thecacherecord component
-
-
Method Details
-
defaultConfig
Creates default production configuration. -
developerConfig
Creates developer configuration with local path. -
developerConfig
Creates developer configuration with custom repository and branch. -
isLocalMode
public boolean isLocalMode()Checks if using local filesystem. -
isRemoteMode
public boolean isRemoteMode()Checks if using remote repository. -
getEffectiveBranch
Gets the effective branch to use. -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
mode
Returns the value of themoderecord component.- Returns:
- the value of the
moderecord component
-
repository
Returns the value of therepositoryrecord component.- Returns:
- the value of the
repositoryrecord component
-
branch
Returns the value of thebranchrecord component.- Returns:
- the value of the
branchrecord component
-
version
Returns the value of theversionrecord component.- Returns:
- the value of the
versionrecord component
-
localPath
Returns the value of thelocalPathrecord component.- Returns:
- the value of the
localPathrecord component
-
cache
public boolean cache()Returns the value of thecacherecord component.- Returns:
- the value of the
cacherecord component
-