Record Class VersionPolicy

java.lang.Object
java.lang.Record
io.github.joke.conventionalversion.calc.VersionPolicy
Record Components:
initialVersion - release-please initial-version
bumpMinorPreMajor - release-please bump-minor-pre-major
bumpPatchForMinorPreMajor - release-please bump-patch-for-minor-pre-major
All Implemented Interfaces:
Serializable

public record VersionPolicy(SemanticVersion initialVersion, boolean bumpMinorPreMajor, boolean bumpPatchForMinorPreMajor) extends Record implements Serializable
The inputs that change the calculated number, named after their release-please counterparts so a divergence between the two configurations is greppable.
See Also:
  • Constructor Details

    • VersionPolicy

      public VersionPolicy(SemanticVersion initialVersion, boolean bumpMinorPreMajor, boolean bumpPatchForMinorPreMajor)
      Creates an instance of a VersionPolicy record class.
      Parameters:
      initialVersion - the value for the initialVersion record component
      bumpMinorPreMajor - the value for the bumpMinorPreMajor record component
      bumpPatchForMinorPreMajor - the value for the bumpPatchForMinorPreMajor record component
  • Method Details

    • defaults

      public static VersionPolicy defaults()
      release-please's defaults. The initial version is 1.0.0 rather than 0.1.0 because that is what release-please actually cuts for a first release.
    • 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 the compare method from their corresponding wrapper classes.
      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.
    • initialVersion

      public SemanticVersion initialVersion()
      Returns the value of the initialVersion record component.
      Returns:
      the value of the initialVersion record component
    • bumpMinorPreMajor

      public boolean bumpMinorPreMajor()
      Returns the value of the bumpMinorPreMajor record component.
      Returns:
      the value of the bumpMinorPreMajor record component
    • bumpPatchForMinorPreMajor

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