Object SemanticVersionComparator.Companion
-
- All Implemented Interfaces:
public class SemanticVersionComparator.Companion
-
-
Field Summary
Fields Modifier and Type Field Description public final static SemanticVersionComparator.CompanionINSTANCE
-
Method Summary
Modifier and Type Method Description final StringfindNewestVersion(List<String> versions)Check a list of versions following the semantic-scheme and find the latest one. final StringfindOldestVersion(List<String> versions)Check a list of versions following the semantic-scheme and find the oldest one. final BooleancompareSemantics(String currentVersion, String newVersion, Comparison comparison)Compare the given new version against the given current version, depending on comparison type EQUAL,NEW, orEQUAL_OR_NEW.-
-
Method Detail
-
findNewestVersion
final String findNewestVersion(List<String> versions)
Check a list of versions following the semantic-scheme and find the latest one.
-
findOldestVersion
final String findOldestVersion(List<String> versions)
Check a list of versions following the semantic-scheme and find the oldest one.
-
compareSemantics
final Boolean compareSemantics(String currentVersion, String newVersion, Comparison comparison)
Compare the given new version against the given current version, depending on comparison type
EQUAL,NEW, orEQUAL_OR_NEW. Checks are performed with the semantic release-formatting, e.g. 1.2.3, 2.3.4, 6.6.6- Parameters:
currentVersion- Current version to check againstnewVersion.newVersion- New version to check againstcurrentVersion.comparison- Comparison level.- Returns:
Boolean. Returns
trueif the new version is indeed newer than the current version. Otherwisefalse.
-
-
-
-