Record Class RepositoryState

java.lang.Object
java.lang.Record
io.github.joke.conventionalversion.calc.RepositoryState
Record Components:
recordedRelease - the version release-please last recorded, or null when the project has never released
headIsReleaseCommit - whether HEAD is the commit that recordedRelease was released at; only ever true when recordedRelease is present
commitMessages - raw messages of the commits in range, oldest first, so that "the most recent wins" is the last match rather than the first
headSha - the commit the build was produced from

public record RepositoryState(@Nullable SemanticVersion recordedRelease, boolean headIsReleaseCommit, List<String> commitMessages, String headSha) extends Record
The repository facts the calculation needs, already gathered.
  • Constructor Details

    • RepositoryState

      public RepositoryState(@Nullable SemanticVersion recordedRelease, boolean headIsReleaseCommit, List<String> commitMessages, String headSha)
      Creates an instance of a RepositoryState record class.
      Parameters:
      recordedRelease - the value for the recordedRelease record component
      headIsReleaseCommit - the value for the headIsReleaseCommit record component
      commitMessages - the value for the commitMessages record component
      headSha - the value for the headSha record component
  • Method Details

    • findRecordedRelease

      public Optional<SemanticVersion> findRecordedRelease()
    • 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.
    • recordedRelease

      public @Nullable SemanticVersion recordedRelease()
      Returns the value of the recordedRelease record component.
      Returns:
      the value of the recordedRelease record component
    • headIsReleaseCommit

      public boolean headIsReleaseCommit()
      Returns the value of the headIsReleaseCommit record component.
      Returns:
      the value of the headIsReleaseCommit record component
    • commitMessages

      public List<String> commitMessages()
      Returns the value of the commitMessages record component.
      Returns:
      the value of the commitMessages record component
    • headSha

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