Module org.eclipse.persistence.core
Class JavaVersion
java.lang.Object
org.eclipse.persistence.internal.helper.JavaVersion
Java version storage class. Used for version numbers retrieved from
Java specification version string. Stored version is in
<major>.<minor> format.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final charJavaEE platform patch version element separator character.static final charJavaEE platform version elements separator character.static final StringJava VM version system property name. -
Constructor Summary
ConstructorsConstructorDescriptionJavaVersion(int major, int minor) Constructs an instance of Java specification version number. -
Method Summary
Modifier and TypeMethodDescriptionintcomapreTo(JavaVersion version) Compares thisJavaVersionobject against another one.intgetMajor()Get major version number.intgetMinor()Get minor version number.ReturnJavaSEPlatformmatching this Java SE specification version.toString()ReturnStringrepresentation of Java VM version object.static JavaVersionJava specification version detector.static StringRetrieves Java specification version String from JDK system property.
-
Field Details
-
SEPARATOR
public static final char SEPARATORJavaEE platform version elements separator character.- See Also:
-
PATCH_SEPARATOR
public static final char PATCH_SEPARATORJavaEE platform patch version element separator character.- See Also:
-
VM_VERSION_PROPERTY
Java VM version system property name.- See Also:
-
-
Constructor Details
-
JavaVersion
public JavaVersion(int major, int minor) Constructs an instance of Java specification version number.- Parameters:
major- Major version number.minor- Minor version number.
-
-
Method Details
-
vmVersionString
Retrieves Java specification version String from JDK system property.- Returns:
- Java specification version String from JDK system property.
-
vmVersion
Java specification version detector. -
getMajor
public int getMajor()Get major version number.- Returns:
- Major version number.
-
getMinor
public int getMinor()Get minor version number.- Returns:
- Minor version number.
-
comapreTo
Compares thisJavaVersionobject against another one.- Parameters:
version-JavaVersionobject to compare withthisobject.- Returns:
- Compare result:
- Value
1ifthisvalue is greater than suppliedversionvalue. - Value
-1ifthisvalue is lesser than suppliedversionvalue. - Value
0if boththisvalue and suppliedversionvalues are equal.
- Value
-
toString
ReturnStringrepresentation of Java VM version object. -
toPlatform
ReturnJavaSEPlatformmatching this Java SE specification version.- Returns:
JavaSEPlatformmatching this Java SE specification version orJavaSEPlatform.DEFAULTas default when platform matching fails.
-