Package lu.kbra.modelizer_next.common
Class VersionComparator
java.lang.Object
lu.kbra.modelizer_next.common.VersionComparator
- All Implemented Interfaces:
Comparator<String>
Parses and compares Modelizer version strings, including release, snapshot, and nightly variants.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordImmutable value object for parsed version data. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final VersionComparatorstatic final Comparator<VersionComparator.ParsedVersion> -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Field Details
-
COMPARATOR
-
PARSED_COMPARATOR
-
-
Constructor Details
-
VersionComparator
public VersionComparator()
-
-
Method Details
-
compare
Compares two values using this comparator's ordering rules.- Specified by:
comparein interfaceComparator<String>- Parameters:
left- text value for leftright- text value for right- Returns:
- a negative value, zero, or a positive value according to the ordering rules
-
parse
Parses the supplied text into the value type used by this class.- Parameters:
version- text value for version- Returns:
- the parsed value
-