Enum JavaSEPlatform
- java.lang.Object
-
- java.lang.Enum<JavaSEPlatform>
-
- org.eclipse.persistence.internal.helper.JavaSEPlatform
-
- All Implemented Interfaces:
Serializable
,Comparable<JavaSEPlatform>
public enum JavaSEPlatform extends Enum<JavaSEPlatform> implements Comparable<JavaSEPlatform>
Java SE platforms supported by EclipseLink.- Author:
- Tomas Kraus, Peter Benedikovic
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
JavaSEPlatform.Version
-
Enum Constant Summary
Enum Constants Enum Constant Description v1_1
Java SE 1.1.v1_2
Java SE 1.2.v1_3
Java SE 1.3.v1_4
Java SE 1.4.v1_5
Java SE 1.5.v1_6
Java SE 1.6.v1_7
Java SE 1.7.v1_8
Java SE 1.8.v10_0
Java SE 10.v11_0
Java SE 11.v12_0
Java SE 12.v13_0
Java SE 13.v14_0
Java SE 14.v9_0
Java SE 9.
-
Field Summary
Fields Modifier and Type Field Description static JavaSEPlatform
CURRENT
Current Java SE platform.static int
LENGTH
GlassFish Java SE platform enumeration length.static JavaSEPlatform
MIN_SUPPORTED
Lowest supported Java SE platform.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static boolean
atLeast(JavaSEPlatform platform)
Check whether current Java SE is at least (greater or equal) provided platform.JavaSEPlatform.Version[]
getAdditionalVersions()
Get additional version numbers.int
getMajor()
Get major version number.int
getMinor()
Get minor version number.boolean
gte(JavaSEPlatform platform)
Check if this platform is equal or greater to specified platform.static boolean
is(JavaSEPlatform platform)
Check whether current Java SE is exactly matching provided platform.boolean
isSupported()
Check whether this platform is supported platform.String
toString()
Return Java SE platform version as human readableString
.static JavaSEPlatform
toValue(int major, int minor)
Returns aJavaSEPlatform
matching providedmajor
andminor
version numbers.static JavaSEPlatform
toValue(String platformName)
Returns aJavaSEPlatform
with a value represented by the specifiedString
.static JavaSEPlatform
valueOf(String name)
Returns the enum constant of this type with the specified name.static JavaSEPlatform[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.String
versionString()
Return computer readableString
containing version numbers in<major> '.' <minor>
format.static String
versionString(int major, int minor)
GenerateString
containing minor and major version numbers in<major> '.' <minor>
format.-
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
-
Methods inherited from interface java.lang.Comparable
compareTo
-
-
-
-
Enum Constant Detail
-
v1_1
public static final JavaSEPlatform v1_1
Java SE 1.1.
-
v1_2
public static final JavaSEPlatform v1_2
Java SE 1.2.
-
v1_3
public static final JavaSEPlatform v1_3
Java SE 1.3.
-
v1_4
public static final JavaSEPlatform v1_4
Java SE 1.4.
-
v1_5
public static final JavaSEPlatform v1_5
Java SE 1.5.
-
v1_6
public static final JavaSEPlatform v1_6
Java SE 1.6.
-
v1_7
public static final JavaSEPlatform v1_7
Java SE 1.7.
-
v1_8
public static final JavaSEPlatform v1_8
Java SE 1.8.
-
v9_0
public static final JavaSEPlatform v9_0
Java SE 9. Version alias 1.9 is added too.
-
v10_0
public static final JavaSEPlatform v10_0
Java SE 10.
-
v11_0
public static final JavaSEPlatform v11_0
Java SE 11.
-
v12_0
public static final JavaSEPlatform v12_0
Java SE 12.
-
v13_0
public static final JavaSEPlatform v13_0
Java SE 13.
-
v14_0
public static final JavaSEPlatform v14_0
Java SE 14.
-
-
Field Detail
-
LENGTH
public static final int LENGTH
GlassFish Java SE platform enumeration length.
-
MIN_SUPPORTED
public static final JavaSEPlatform MIN_SUPPORTED
Lowest supported Java SE platform. Currently it's Java SE 1.8.
-
CURRENT
public static final JavaSEPlatform CURRENT
Current Java SE platform.
-
-
Method Detail
-
values
public static JavaSEPlatform[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (JavaSEPlatform c : JavaSEPlatform.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static JavaSEPlatform valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
is
public static boolean is(JavaSEPlatform platform)
Check whether current Java SE is exactly matching provided platform.- Parameters:
platform
- Java SE platform to compare with.
-
atLeast
public static boolean atLeast(JavaSEPlatform platform)
Check whether current Java SE is at least (greater or equal) provided platform.- Parameters:
platform
- Java SE platform to compare with.
-
toValue
public static JavaSEPlatform toValue(String platformName)
Returns aJavaSEPlatform
with a value represented by the specifiedString
. TheJavaSEPlatform
returned represents existing value only if specifiedString
matches anyString
returned byversionString()
method. Otherwisenull
value is returned.- Parameters:
platformName
- Value containingJavaSEPlatform
versionString
representation.- Returns:
JavaSEPlatform
value represented byString
ornull
if value was not recognized.
-
toValue
public static JavaSEPlatform toValue(int major, int minor)
Returns aJavaSEPlatform
matching providedmajor
andminor
version numbers.- Parameters:
major
- Major version number.minor
- Minor version number.- Returns:
JavaSEPlatform
value matching providedmajor
andminor
version numbers.JavaSEPlatform.DEFAULT
value is returned for unknown Java SE version numbers.
-
versionString
public static final String versionString(int major, int minor)
GenerateString
containing minor and major version numbers in<major> '.' <minor>
format.- Parameters:
major
- Major version number.minor
- Minor version number.- Returns:
- Generated
String
-
getMajor
public final int getMajor()
Get major version number.- Returns:
- Major version number.
-
getMinor
public final int getMinor()
Get minor version number.- Returns:
- Minor version number.
-
getAdditionalVersions
public final JavaSEPlatform.Version[] getAdditionalVersions()
Get additional version numbers.- Returns:
- an array of additional version numbers if exist or
null
if no additional version numbers are defined.
-
gte
public boolean gte(JavaSEPlatform platform)
Check if this platform is equal or greater to specified platform.- Parameters:
platform
- Platform to compare with.- Returns:
- Value of
true
if this platform is equal or greater to specified platform orfalse
otherwise.
-
isSupported
public boolean isSupported()
Check whether this platform is supported platform.- Returns:
- Value of
true
when this platform is supported platform orfalse
otherwise.
-
versionString
public String versionString()
Return computer readableString
containing version numbers in<major> '.' <minor>
format.- Returns:
- computer readable
String
containing version numbers
-
toString
public String toString()
Return Java SE platform version as human readableString
.- Overrides:
toString
in classEnum<JavaSEPlatform>
- Returns:
- Java SE platform version as human readable
String
.
-
-