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
ConstructorDescriptionCLNVersion
(int major, int minor) Creates an instance of aCLNVersion
record class. -
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(CLNVersion other) final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.int
major()
Returns the value of themajor
record component.int
minor()
Returns the value of theminor
record component.static CLNVersion
Parse 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:
compareTo
in 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 themajor
record component.- Returns:
- the value of the
major
record component
-
minor
public int minor()Returns the value of theminor
record component.- Returns:
- the value of the
minor
record component
-