Package alpine.common.util
Class VersionComparator
java.lang.Object
alpine.common.util.VersionComparator
A class that compares semantic versions from one to another.
- Since:
- 1.0.0
- Author:
- Steve Springett
-
Constructor Summary
ConstructorsConstructorDescriptionVersionComparator(String version) Constructs a new VersionComparator using the specified semantic version. -
Method Summary
Modifier and TypeMethodDescriptionbooleanintgetMajor()intgetMinor()intintinthashCode()booleanisNewerThan(VersionComparator comparator) Determines if the specified VersionComparator is newer than this instance.booleanisOlderThan(VersionComparator comparator) Determines if the specified VersionComparator is older than this instance.booleantoString()
-
Constructor Details
-
VersionComparator
Constructs a new VersionComparator using the specified semantic version.- Parameters:
version- the semantic version
-
-
Method Details
-
isNewerThan
Determines if the specified VersionComparator is newer than this instance.- Parameters:
comparator- a VersionComparator to compare to- Returns:
- true if specified version if newer, false if not
-
isOlderThan
Determines if the specified VersionComparator is older than this instance.- Parameters:
comparator- a VersionComparator to compare to- Returns:
- true if specified version if older, false if not
-
equals
-
hashCode
public int hashCode() -
getMajor
public int getMajor() -
getMinor
public int getMinor() -
getRevision
public int getRevision() -
isSnapshot
public boolean isSnapshot() -
getPrereleaseNumber
public int getPrereleaseNumber() -
toString
-