Package de.eldoria.eldoutilities.utils
Record Class Version
java.lang.Object
java.lang.Record
de.eldoria.eldoutilities.utils.Version
- All Implemented Interfaces:
Comparable<Version>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintdecrease(int index, int value) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.increase(int index, int value) booleanCompares the version to a lower and upper versionbooleanisBetweenInclusive(Version lower, Version upper) booleanbooleanbooleanisNewerOrEqual(Version version) booleanbooleanisOlderOrEqual(Version version) nums()Returns the value of thenumsrecord component.static Versionstatic Versionstatic Versionset(int index, int value) intsize()toString()Returns a string representation of this record class.trim(int num) version()Returns the value of theversionrecord component.
-
Field Details
-
MAJOR
public static final int MAJOR- See Also:
-
MINOR
public static final int MINOR- See Also:
-
PATCH
public static final int PATCH- See Also:
-
-
Constructor Details
-
Version
Creates an instance of aVersionrecord class.- Parameters:
version- the value for theversionrecord componentnums- the value for thenumsrecord component
-
-
Method Details
-
parse
-
of
-
of
-
nums
Returns the value of thenumsrecord component.- Returns:
- the value of the
numsrecord component
-
isOlder
-
isOlderOrEqual
-
isNewer
-
isNewerOrEqual
-
isEqual
-
isBetweenInclusive
-
isBetween
Compares the version to a lower and upper version- Parameters:
lower- lower version (inclusive)upper- upper version (exclusive)- Returns:
- true if the version is between
-
comparator
-
trim
-
set
-
increase
-
decrease
-
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. -
size
public int size() -
compareTo
- Specified by:
compareToin interfaceComparable<Version>
-
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 withObjects::equals(Object,Object). -
version
Returns the value of theversionrecord component.- Returns:
- the value of the
versionrecord component
-