Package com.io7m.cedarbridge.version
Record Class CBVersion
java.lang.Object
java.lang.Record
com.io7m.cedarbridge.version.CBVersion
- Record Components:
major- The major versionminor- The minor versionpatch- The patch versionqualifier- The qualifier
- All Implemented Interfaces:
Comparable<CBVersion>,Formattable
public record CBVersion(int major, int minor, int patch, String qualifier)
extends Record
implements Comparable<CBVersion>, Formattable
A semantic version number.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintfinal booleanIndicates whether some other object is "equal to" this one.voidfinal inthashCode()Returns a hash code value for this object.intmajor()Returns the value of themajorrecord component.intminor()Returns the value of theminorrecord component.intpatch()Returns the value of thepatchrecord component.Returns the value of thequalifierrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
CBVersion
A semantic version number.- Parameters:
major- The major versionminor- The minor versionpatch- The patch versionqualifier- The qualifier
-
-
Method Details
-
compareTo
- Specified by:
compareToin interfaceComparable<CBVersion>
-
formatTo
- Specified by:
formatToin interfaceFormattable
-
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 '=='. -
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
-
qualifier
Returns the value of thequalifierrecord component.- Returns:
- the value of the
qualifierrecord component
-