Record Class ARI1Version
java.lang.Object
java.lang.Record
com.io7m.aradine.instrument.spi1.ARI1Version
- Record Components:
major- The major numberminor- The minor numberpatch- The patch numberqualifier- The (possibly empty) qualifier
- All Implemented Interfaces:
Comparable<ARI1Version>
public record ARI1Version(int major, int minor, int patch, Optional<ARI1VersionQualifier> qualifier)
extends Record
implements Comparable<ARI1Version>
A (semantic) version number.
-
Constructor Summary
ConstructorsConstructorDescriptionARI1Version(int major, int minor, int patch, Optional<ARI1VersionQualifier> qualifier) A (semantic) version number. -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(ARI1Version other) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanintmajor()Returns the value of themajorrecord component.intminor()Returns the value of theminorrecord component.static ARI1Versionof(int major, int minor, int patch) Create a version number without a qualifier.static ARI1Versionof(int major, int minor, int patch, ARI1VersionQualifier qualifier) Create a version number with a qualifier.static ARI1VersionCreate a version number with a qualifier.intpatch()Returns the value of thepatchrecord component.Returns the value of thequalifierrecord component.toString()Returns a string representation of this record class.
-
Constructor Details
-
ARI1Version
A (semantic) version number.- Parameters:
major- The major numberminor- The minor numberpatch- The patch numberqualifier- The (possibly empty) qualifier
-
-
Method Details
-
isSnapshot
public boolean isSnapshot()- Returns:
trueif this version is a snapshot version
-
of
Create a version number without a qualifier.- Parameters:
major- The major versionminor- The minor versionpatch- The patch version- Returns:
- A version number
-
of
Create a version number with a qualifier.- Parameters:
major- The major versionminor- The minor versionpatch- The patch versionqualifier- The qualifier- Returns:
- A version number
-
of
public static ARI1Version of(int major, int minor, int patch, String qualifier) throws IllegalArgumentException Create a version number with a qualifier.- Parameters:
major- The major versionminor- The minor versionpatch- The patch versionqualifier- The qualifier- Returns:
- A version number
- Throws:
IllegalArgumentException- On unparseable qualifiers
-
toString
-
compareTo
- Specified by:
compareToin interfaceComparable<ARI1Version>
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
major
-
minor
-
patch
-
qualifier
-