Package org.springframework.data.util
Class Version
java.lang.Object
org.springframework.data.util.Version
- All Implemented Interfaces:
Comparable<Version>
Value object to represent a Version consisting of major, minor and bugfix part.
- Author:
- Oliver Gierke
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
boolean
int
hashCode()
boolean
Returns whether the currentVersion
is the same as the given one.boolean
isGreaterThan
(Version version) Returns whether the currentVersion
is greater (newer) than the given one.boolean
isGreaterThanOrEqualTo
(Version version) Returns whether the currentVersion
is greater (newer) or the same as the given one.boolean
isLessThan
(Version version) Returns whether the currentVersion
is less (older) than the given one.boolean
isLessThanOrEqualTo
(Version version) Returns whether the currentVersion
is less (older) or equal to the current one.static Version
Returns the Java version of the running JVM.static Version
Parses the given string representation of a version into aVersion
object.toString()
-
Constructor Details
-
Version
public Version(int... parts) Creates a newVersion
from the given integer values. At least one value has to be given but a maximum of 4.- Parameters:
parts
- must not be null or empty.
-
-
Method Details
-
parse
Parses the given string representation of a version into aVersion
object.- Parameters:
version
- must not be null or empty.- Returns:
-
javaVersion
Returns the Java version of the running JVM.- Returns:
- will never be null.
-
isGreaterThan
Returns whether the currentVersion
is greater (newer) than the given one.- Parameters:
version
-- Returns:
-
isGreaterThanOrEqualTo
Returns whether the currentVersion
is greater (newer) or the same as the given one.- Parameters:
version
-- Returns:
-
is
Returns whether the currentVersion
is the same as the given one.- Parameters:
version
-- Returns:
-
isLessThan
Returns whether the currentVersion
is less (older) than the given one.- Parameters:
version
-- Returns:
-
isLessThanOrEqualTo
Returns whether the currentVersion
is less (older) or equal to the current one.- Parameters:
version
-- Returns:
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Version>
-
equals
-
hashCode
public int hashCode() -
toString
-