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 Details

    • TemplateConfig

      public TemplateConfig(TemplateMode mode, String repository, String branch, String version, String localPath, boolean cache)
      Creates an instance of a TemplateConfig record class.
      Parameters:
      mode - the value for the mode record component
      repository - the value for the repository record component
      branch - the value for the branch record component
      version - the value for the version record component
      localPath - the value for the localPath record component
      cache - the value for the cache record component
  • Method Details

    • defaultConfig

      public static TemplateConfig defaultConfig()
      Creates default production configuration.
    • developerConfig

      public static TemplateConfig developerConfig(String localPath)
      Creates developer configuration with local path.
    • developerConfig

      public static TemplateConfig developerConfig(String repository, String branch)
      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

      public String getEffectiveBranch()
      Gets the effective branch to use.
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • mode

      public TemplateMode mode()
      Returns the value of the mode record component.
      Returns:
      the value of the mode record component
    • repository

      public String repository()
      Returns the value of the repository record component.
      Returns:
      the value of the repository record component
    • branch

      public String branch()
      Returns the value of the branch record component.
      Returns:
      the value of the branch record component
    • version

      public String version()
      Returns the value of the version record component.
      Returns:
      the value of the version record component
    • localPath

      public String localPath()
      Returns the value of the localPath record component.
      Returns:
      the value of the localPath record component
    • cache

      public boolean cache()
      Returns the value of the cache record component.
      Returns:
      the value of the cache record component