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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintbooleaninthashCode()booleanReturns whether the currentVersionis the same as the given one.booleanisGreaterThan(Version version) Returns whether the currentVersionis greater (newer) than the given one.booleanisGreaterThanOrEqualTo(Version version) Returns whether the currentVersionis greater (newer) or the same as the given one.booleanisLessThan(Version version) Returns whether the currentVersionis less (older) than the given one.booleanisLessThanOrEqualTo(Version version) Returns whether the currentVersionis less (older) or equal to the current one.static VersionReturns the Java version of the running JVM.static VersionParses the given string representation of a version into aVersionobject.toString()
-
Constructor Details
-
Version
public Version(int... parts) Creates a newVersionfrom 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 aVersionobject.- 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 currentVersionis greater (newer) than the given one.- Parameters:
version-- Returns:
-
isGreaterThanOrEqualTo
Returns whether the currentVersionis greater (newer) or the same as the given one.- Parameters:
version-- Returns:
-
is
Returns whether the currentVersionis the same as the given one.- Parameters:
version-- Returns:
-
isLessThan
Returns whether the currentVersionis less (older) than the given one.- Parameters:
version-- Returns:
-
isLessThanOrEqualTo
Returns whether the currentVersionis less (older) or equal to the current one.- Parameters:
version-- Returns:
-
compareTo
- Specified by:
compareToin interfaceComparable<Version>
-
equals
-
hashCode
public int hashCode() -
toString
-