Package org.apache.commons.lang3
Enum JavaVersion
- All Implemented Interfaces:
- Serializable,- Comparable<JavaVersion>
An enum representing all the versions of the Java specification.
 This is intended to mirror available values from the
 java.specification.version System property.
- Since:
- 3.0
- 
Enum Constant SummaryEnum ConstantsEnum ConstantDescriptionThe Java version reported by Android.Java 1.1.Java 1.2.Java 1.3.Java 1.4.Java 1.5.Java 1.6.Java 1.7.Java 1.8.Deprecated.Java 10.Java 11.Java 12.Java 13.Java 14.Java 15.Java 16.Java 17.Java 18.Java 19.Java 20.Java 21.Java 22.Java 9.The most recent Java version.
- 
Method SummaryModifier and TypeMethodDescriptionbooleanatLeast(JavaVersion requiredVersion) Tests whether this version of Java is at least the version of Java passed in.booleanatMost(JavaVersion requiredVersion) Tests whether this version of Java is at most the version of Java passed in.toString()The string value is overridden to return the standard name.static JavaVersionReturns the enum constant of this type with the specified name.static JavaVersion[]values()Returns an array containing the constants of this enum type, in the order they are declared.
- 
Enum Constant Details- 
JAVA_0_9The Java version reported by Android. This is not an official Java version number.
- 
JAVA_1_1Java 1.1.
- 
JAVA_1_2Java 1.2.
- 
JAVA_1_3Java 1.3.
- 
JAVA_1_4Java 1.4.
- 
JAVA_1_5Java 1.5.
- 
JAVA_1_6Java 1.6.
- 
JAVA_1_7Java 1.7.
- 
JAVA_1_8Java 1.8.
- 
JAVA_1_9Deprecated.As of release 3.5, replaced byJAVA_9Java 1.9.
- 
JAVA_9Java 9.- Since:
- 3.5
 
- 
JAVA_10Java 10.- Since:
- 3.7
 
- 
JAVA_11Java 11.- Since:
- 3.8
 
- 
JAVA_12Java 12.- Since:
- 3.9
 
- 
JAVA_13Java 13.- Since:
- 3.9
 
- 
JAVA_14Java 14.- Since:
- 3.11
 
- 
JAVA_15Java 15.- Since:
- 3.11
 
- 
JAVA_16Java 16.- Since:
- 3.11
 
- 
JAVA_17Java 17.- Since:
- 3.12.0
 
- 
JAVA_18Java 18.- Since:
- 3.13.0
 
- 
JAVA_19Java 19.- Since:
- 3.13.0
 
- 
JAVA_20Java 20.- Since:
- 3.13.0
 
- 
JAVA_21Java 21.- Since:
- 3.13.0
 
- 
JAVA_22Java 22.- Since:
- 3.15.0
 
- 
JAVA_RECENTThe most recent Java version. Mainly introduced to avoid to break when a new version of Java is used.
 
- 
- 
Method Details- 
valuesReturns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
 
- 
valueOfReturns 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 name
- NullPointerException- if the argument is null
 
- 
atLeastTests whether this version of Java is at least the version of Java passed in.For example: 
 myVersion.atLeast(JavaVersion.JAVA_1_4)- Parameters:
- requiredVersion- the version to check against, not null
- Returns:
- true if this version is equal to or greater than the specified version
 
- 
atMostTests whether this version of Java is at most the version of Java passed in.For example: 
 myVersion.atMost(JavaVersion.JAVA_1_4)- Parameters:
- requiredVersion- the version to check against, not null
- Returns:
- true if this version is equal to or greater than the specified version
- Since:
- 3.9
 
- 
toStringThe string value is overridden to return the standard name.For example, "1.5".- Overrides:
- toStringin class- Enum<JavaVersion>
- Returns:
- the name, not null
 
 
- 
JAVA_9