Record Class SemVer
java.lang.Object
java.lang.Record
net.mathias2246.buildmc.api.messageBus.SemVer
-
Constructor Summary
ConstructorsConstructorDescriptionSemVer(int major, int minor, int patch) Creates an instance of aSemVerrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanisCompatibleWith(SemVer other) intmajor()Returns the value of themajorrecord component.intminor()Returns the value of theminorrecord component.static SemVerof(int major, int minor, int patch) static SemVerintpatch()Returns the value of thepatchrecord component.@NonNull StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SemVer
public SemVer(int major, int minor, int patch) Creates an instance of aSemVerrecord class.- Parameters:
major- the value for themajorrecord componentminor- the value for theminorrecord componentpatch- the value for thepatchrecord component
-
-
Method Details
-
parse
-
of
@Contract(value="_, _, _, -> new", pure=true) public static SemVer of(int major, int minor, int patch) -
isCompatibleWith
-
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
-
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. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
major
public int major()Returns the value of themajorrecord component.- Returns:
- the value of the
majorrecord component
-
minor
public int minor()Returns the value of theminorrecord component.- Returns:
- the value of the
minorrecord component
-
patch
public int patch()Returns the value of thepatchrecord component.- Returns:
- the value of the
patchrecord component
-