Package migratedb.v1.core.api
Class Version
java.lang.Object
migratedb.v1.core.api.Version
- All Implemented Interfaces:
Comparable<Version>
Note: "1.0" and "1.0.0" are considered equivalent by
compareTo(Version) and equals(Object)!-
Method Summary
Modifier and TypeMethodDescriptionintbooleangetMajor()inthashCode()booleanConvenience method for quickly checking whether this version is at least as new as this other version.booleanisMajorNewerThan(String otherVersion) Convenience method for quickly checking whether this major version is newer than this other major version.booleanisNewerThan(String otherVersion) Convenience method for quickly checking whether this version is newer than this other version.static VersionParses a version fromversion.toString()
-
Method Details
-
parse
Parses a version fromversion. -
toString
-
equals
-
hashCode
public int hashCode() -
isAtLeast
Convenience method for quickly checking whether this version is at least as new as this other version.- Parameters:
otherVersion- The other version.- Returns:
trueif this version is equal or newer,falseif it is older.
-
isNewerThan
Convenience method for quickly checking whether this version is newer than this other version.- Parameters:
otherVersion- The other version.- Returns:
trueif this version is newer,falseif it is not.
-
isMajorNewerThan
Convenience method for quickly checking whether this major version is newer than this other major version.- Parameters:
otherVersion- The other version.- Returns:
trueif this major version is newer,falseif it is not.
-
getMajor
- Returns:
- The major version.
-
getMajorAsString
- Returns:
- The major version as a string.
-
getMinorAsString
- Returns:
- The minor version as a string.
-
compareTo
- Specified by:
compareToin interfaceComparable<Version>
-