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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
decrease
(int index, int value) final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.increase
(int index, int value) boolean
Compares the version to a lower and upper versionboolean
isBetweenInclusive
(Version lower, Version upper) boolean
boolean
boolean
isNewerOrEqual
(Version version) boolean
boolean
isOlderOrEqual
(Version version) nums()
Returns the value of thenums
record component.static Version
static Version
static Version
set
(int index, int value) int
size()
toString()
Returns a string representation of this record class.trim
(int num) version()
Returns the value of theversion
record 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 aVersion
record class.- Parameters:
version
- the value for theversion
record componentnums
- the value for thenums
record component
-
-
Method Details
-
parse
-
of
-
of
-
nums
Returns the value of thenums
record component.- Returns:
- the value of the
nums
record 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:
compareTo
in 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 theversion
record component.- Returns:
- the value of the
version
record component
-