Record Class VersionResult

java.lang.Object
java.lang.Record
io.github.joke.conventionalversion.calc.VersionResult
Record Components:
version - the version string, bare on a release commit and -SNAPSHOT otherwise
bump - what the analysed commits implied, before any override or floor was applied
releasable - whether the range warrants a release; publishing is gated on this rather than on inferring intent from version
sha - the commit the build was produced from, for the jar manifest rather than the coordinate
All Implemented Interfaces:
Serializable

public record VersionResult(String version, Bump bump, boolean releasable, String sha) extends Record implements Serializable
The outcome of a calculation.

Serializable because this is the value a ValueSource hands back: it is stored in the configuration cache entry and captured by the isolated action that assigns project versions.

See Also:
  • Constructor Details

    • VersionResult

      public VersionResult(String version, Bump bump, boolean releasable, String sha)
      Creates an instance of a VersionResult record class.
      Parameters:
      version - the value for the version record component
      bump - the value for the bump record component
      releasable - the value for the releasable record component
      sha - the value for the sha record component
  • Method Details

    • 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.
    • version

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

      public Bump bump()
      Returns the value of the bump record component.
      Returns:
      the value of the bump record component
    • releasable

      public boolean releasable()
      Returns the value of the releasable record component.
      Returns:
      the value of the releasable record component
    • sha

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