Package com.helger.commons.system
Enum EJVMVendor
- java.lang.Object
-
- java.lang.Enum<EJVMVendor>
-
- com.helger.commons.system.EJVMVendor
-
- All Implemented Interfaces:
Serializable,Comparable<EJVMVendor>
public enum EJVMVendor extends Enum<EJVMVendor>
Determine the current JVM (Java Virtual Machine) vendor.- Author:
- Philip Helger
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ORACLE_CLIENTORACLE_SERVERSUN_CLIENTSUN_SERVERUNKNOWN
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract booleandetermineIfItIsCurrentJVMVendor()static EJVMVendorgetCurrentVendor()booleanisJVMVendor()booleanisOracle()booleanisSun()static EJVMVendorvalueOf(String name)Returns the enum constant of this type with the specified name.static EJVMVendor[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
SUN_CLIENT
public static final EJVMVendor SUN_CLIENT
-
SUN_SERVER
public static final EJVMVendor SUN_SERVER
-
ORACLE_CLIENT
public static final EJVMVendor ORACLE_CLIENT
-
ORACLE_SERVER
public static final EJVMVendor ORACLE_SERVER
-
UNKNOWN
public static final EJVMVendor UNKNOWN
-
-
Method Detail
-
values
public static EJVMVendor[] 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 (EJVMVendor c : EJVMVendor.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static EJVMVendor 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
-
determineIfItIsCurrentJVMVendor
protected abstract boolean determineIfItIsCurrentJVMVendor()
-
isJVMVendor
public final boolean isJVMVendor()
-
isSun
public final boolean isSun()
- Returns:
trueif this is a Sun JVM (usually for Java ≤ 1.6).
-
isOracle
public final boolean isOracle()
- Returns:
trueif this is an Oracle JVM (for Java ≥ 1.7).
-
getCurrentVendor
@Nonnull public static EJVMVendor getCurrentVendor()
- Returns:
- The current JVM vendor. If the vendor could not be determined,
UNKNOWNis returned and nevernull.
-
-