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 branchdistance- commits between the baseline tag andHEAD, or the total commit count without a tagdirty- 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 distance, 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 distance, boolean dirty, boolean pushed) Creates an instance of aGitStaterecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleandirty()Returns the value of thedirtyrecord component.longdistance()Returns the value of thedistancerecord component.final booleanIndicates whether some other object is "equal to" this one.booleanexactTag()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 distance, boolean dirty, boolean pushed) Creates an instance of aGitStaterecord class.
-
-
Method Details
-
exactTag
public boolean exactTag()- Returns:
- whether
HEADis the baseline tag itself
-
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
-
distance
public long distance()Returns the value of thedistancerecord component.- Returns:
- the value of the
distancerecord 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
-