Package com.cleanroommc.versioning
Record Class GitState
java.lang.Object
java.lang.Record
com.cleanroommc.versioning.GitState
- Record Components:
latestTag- the highest numeric tag reachable fromHEAD, ornullbefore the first tagtarget- the version the current branch leads to, ornulloutside a development branchcommits- the number of commits reachable fromHEADexactTag- whetherHEADis the baseline tag itselfdirty- whether the worktree has uncommitted changespushed- whetherHEADis contained in a remote-tracking ref
- All Implemented Interfaces:
Serializable
public record GitState(SemanticVersion latestTag, SemanticVersion target, long commits, boolean exactTag, boolean dirty, boolean pushed)
extends Record
implements Serializable
Git inputs used to calculate a version.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionGitState(SemanticVersion latestTag, SemanticVersion target, long commits, boolean exactTag, boolean dirty, boolean pushed) Creates an instance of aGitStaterecord class. -
Method Summary
Modifier and TypeMethodDescriptionlongcommits()Returns the value of thecommitsrecord component.booleandirty()Returns the value of thedirtyrecord component.final booleanIndicates whether some other object is "equal to" this one.booleanexactTag()Returns the value of theexactTagrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of thelatestTagrecord component.booleanpushed()Returns the value of thepushedrecord component.target()Returns the value of thetargetrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
GitState
public GitState(SemanticVersion latestTag, SemanticVersion target, long commits, boolean exactTag, boolean dirty, boolean pushed) Creates an instance of aGitStaterecord class.- Parameters:
latestTag- the value for thelatestTagrecord componenttarget- the value for thetargetrecord componentcommits- the value for thecommitsrecord componentexactTag- the value for theexactTagrecord componentdirty- the value for thedirtyrecord componentpushed- the value for thepushedrecord component
-
-
Method Details
-
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
latestTag
Returns the value of thelatestTagrecord component.- Returns:
- the value of the
latestTagrecord component
-
target
Returns the value of thetargetrecord component.- Returns:
- the value of the
targetrecord component
-
commits
public long commits()Returns the value of thecommitsrecord component.- Returns:
- the value of the
commitsrecord component
-
exactTag
public boolean exactTag()Returns the value of theexactTagrecord component.- Returns:
- the value of the
exactTagrecord component
-
dirty
public boolean dirty()Returns the value of thedirtyrecord component.- Returns:
- the value of the
dirtyrecord component
-
pushed
public boolean pushed()Returns the value of thepushedrecord component.- Returns:
- the value of the
pushedrecord component
-