Record Class ApiVersion
java.lang.Object
java.lang.Record
dev.yowsef.stealablock.api.ApiVersion
- All Implemented Interfaces:
Comparable<ApiVersion>
public record ApiVersion(int major, int minor, int patch)
extends Record
implements Comparable<ApiVersion>
Semantic version of the StealABlock Developer API.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionApiVersion(int major, int minor, int patch) Creates an instance of aApiVersionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(@NotNull ApiVersion other) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanisAtLeast(int reqMajor, int reqMinor) booleanisAtLeast(int reqMajor, int reqMinor, int reqPatch) booleanisCompatibleWith(@NotNull ApiVersion required) intmajor()Returns the value of themajorrecord component.intminor()Returns the value of theminorrecord component.intpatch()Returns the value of thepatchrecord component.@NotNull StringtoString()Returns a string representation of this record class.
-
Field Details
-
CURRENT
-
-
Constructor Details
-
ApiVersion
public ApiVersion(int major, int minor, int patch) Creates an instance of aApiVersionrecord class.- Parameters:
major- the value for themajorrecord componentminor- the value for theminorrecord componentpatch- the value for thepatchrecord component
-
-
Method Details
-
isAtLeast
public boolean isAtLeast(int reqMajor, int reqMinor) -
isAtLeast
public boolean isAtLeast(int reqMajor, int reqMinor, int reqPatch) -
isCompatibleWith
-
compareTo
- Specified by:
compareToin interfaceComparable<ApiVersion>
-
toString
-
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
-