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
-
javaVersion
Returns the Java version of the running JVM.- Returns:
- will never be null.
-
isGreaterThan
-
isGreaterThanOrEqualTo
-
is
-
isLessThan
-
isLessThanOrEqualTo
-
compareTo
- Specified by:
compareToin interfaceComparable<Version>
-
equals
-
hashCode
-
toString
-