Package com.io7m.calino.api
Record Class CLNVersion
java.lang.Object
java.lang.Record
com.io7m.calino.api.CLNVersion
- Record Components:
major- The major versionminor- The minor version
- All Implemented Interfaces:
Comparable<CLNVersion>
A version number.
-
Constructor Summary
ConstructorsConstructorDescriptionCLNVersion(int major, int minor) Creates an instance of aCLNVersionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(CLNVersion other) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intmajor()Returns the value of themajorrecord component.intminor()Returns the value of theminorrecord component.static CLNVersionParse a version string.toString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
parse
Parse a version string.- Parameters:
text- The text- Returns:
- A version string
- Throws:
ParseException- On parse errors
-
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. -
compareTo
- Specified by:
compareToin interfaceComparable<CLNVersion>
-
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. All components in this record class 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
-