Record Class GitFlowConfig

java.lang.Object
java.lang.Record
io.github.jbastgen.stemma.gitflow.GitFlowConfig
Record Components:
production - long-lived branch holding released code (gitflow.branch.master), e.g. main
development - long-lived integration branch (gitflow.branch.develop), e.g. develop
featurePrefix - gitflow.prefix.feature, e.g. feature/
releasePrefix - gitflow.prefix.release
hotfixPrefix - gitflow.prefix.hotfix
supportPrefix - gitflow.prefix.support
versionTagPrefix - gitflow.prefix.versiontag, e.g. v; may be empty

public record GitFlowConfig(String production, String development, String featurePrefix, String releasePrefix, String hotfixPrefix, String supportPrefix, String versionTagPrefix) extends Record
Branch names and prefixes of a repository. Stored in the same gitflow.* keys as the git flow command line tool, so repositories initialised by either tool work with both.
  • Field Details

  • Constructor Details

    • GitFlowConfig

      public GitFlowConfig(String production, String development, String featurePrefix, String releasePrefix, String hotfixPrefix, String supportPrefix, String versionTagPrefix)
      Creates an instance of a GitFlowConfig record class.
      Parameters:
      production - the value for the production record component
      development - the value for the development record component
      featurePrefix - the value for the featurePrefix record component
      releasePrefix - the value for the releasePrefix record component
      hotfixPrefix - the value for the hotfixPrefix record component
      supportPrefix - the value for the supportPrefix record component
      versionTagPrefix - the value for the versionTagPrefix record component
  • Method Details

    • defaults

      public static GitFlowConfig defaults(String production)
      The conventional defaults for a repository whose production branch is production.
    • prefix

      public String prefix(Kind kind)
      The prefix of the branches of this kind, e.g. feature/.
    • base

      public String base(Kind kind)
      The branch a new branch of this kind starts from.
    • 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.
    • production

      public String production()
      Returns the value of the production record component.
      Returns:
      the value of the production record component
    • development

      public String development()
      Returns the value of the development record component.
      Returns:
      the value of the development record component
    • featurePrefix

      public String featurePrefix()
      Returns the value of the featurePrefix record component.
      Returns:
      the value of the featurePrefix record component
    • releasePrefix

      public String releasePrefix()
      Returns the value of the releasePrefix record component.
      Returns:
      the value of the releasePrefix record component
    • hotfixPrefix

      public String hotfixPrefix()
      Returns the value of the hotfixPrefix record component.
      Returns:
      the value of the hotfixPrefix record component
    • supportPrefix

      public String supportPrefix()
      Returns the value of the supportPrefix record component.
      Returns:
      the value of the supportPrefix record component
    • versionTagPrefix

      public String versionTagPrefix()
      Returns the value of the versionTagPrefix record component.
      Returns:
      the value of the versionTagPrefix record component