Package org.objenesis.strategy
Class PlatformDescription
- java.lang.Object
-
- org.objenesis.strategy.PlatformDescription
-
public final class PlatformDescription extends java.lang.ObjectList of constants describing the currently used platform.
-
-
Field Summary
Fields Modifier and Type Field Description static intANDROID_VERSIONAndroid version.static java.lang.StringDALVIKJVM_NAME prefix for Dalvik/Androidstatic java.lang.StringGAE_VERSIONGoogle App Engine version or null is we are not on GAEstatic java.lang.StringGNUJVM_NAME prefix for GCJstatic java.lang.StringHOTSPOTJVM_NAME prefix for Java HotSpotstatic booleanIS_ANDROID_OPENJDKFlag telling if this version of Android is based on the OpenJDKstatic java.lang.StringJVM_NAMEJVM namestatic java.lang.StringOPENJDKJVM_NAME prefix for the OpenJDKstatic java.lang.StringPERCJVM_NAME prefix for Aonix PERCstatic java.lang.StringSPECIFICATION_VERSIONJava specification versionstatic java.lang.StringSUNDeprecated.UseHOTSPOTinsteadstatic java.lang.StringVENDORVM vendor namestatic java.lang.StringVENDOR_VERSIONVM vendor versionstatic java.lang.StringVM_INFOJVM versionstatic java.lang.StringVM_VERSIONJVM version
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringdescribePlatform()Describes the platform.static booleanisAfterJava11()Tells if the current JVM is running Java 11 or abovestatic booleanisAfterJigsaw()Tells if the current JVM is running Java 9 or abovestatic booleanisAndroidOpenJDK()Check if this JVM is an Android JVM based on OpenJDK.static booleanisGoogleAppEngine()static booleanisThisJVM(java.lang.String name)Check if the current JVM is of the type passed in parameter.
-
-
-
Field Detail
-
GNU
public static final java.lang.String GNU
JVM_NAME prefix for GCJ- See Also:
- Constant Field Values
-
HOTSPOT
public static final java.lang.String HOTSPOT
JVM_NAME prefix for Java HotSpot- See Also:
- Constant Field Values
-
SUN
@Deprecated public static final java.lang.String SUN
Deprecated.UseHOTSPOTinsteadJVM_NAME prefix for Java HotSpot- See Also:
- Constant Field Values
-
OPENJDK
public static final java.lang.String OPENJDK
JVM_NAME prefix for the OpenJDK- See Also:
- Constant Field Values
-
PERC
public static final java.lang.String PERC
JVM_NAME prefix for Aonix PERC- See Also:
- Constant Field Values
-
DALVIK
public static final java.lang.String DALVIK
JVM_NAME prefix for Dalvik/Android- See Also:
- Constant Field Values
-
SPECIFICATION_VERSION
public static final java.lang.String SPECIFICATION_VERSION
Java specification version
-
VM_VERSION
public static final java.lang.String VM_VERSION
JVM version
-
VM_INFO
public static final java.lang.String VM_INFO
JVM version
-
VENDOR_VERSION
public static final java.lang.String VENDOR_VERSION
VM vendor version
-
VENDOR
public static final java.lang.String VENDOR
VM vendor name
-
JVM_NAME
public static final java.lang.String JVM_NAME
JVM name
-
ANDROID_VERSION
public static final int ANDROID_VERSION
Android version. Will be 0 for none android platform
-
IS_ANDROID_OPENJDK
public static final boolean IS_ANDROID_OPENJDK
Flag telling if this version of Android is based on the OpenJDK
-
GAE_VERSION
public static final java.lang.String GAE_VERSION
Google App Engine version or null is we are not on GAE
-
-
Method Detail
-
describePlatform
public static java.lang.String describePlatform()
Describes the platform. Outputs Java version and vendor.- Returns:
- Description of the current platform
-
isThisJVM
public static boolean isThisJVM(java.lang.String name)
Check if the current JVM is of the type passed in parameter. Normally, this will be a constant from this class. We basically doSystem.getProperty("java.vm.name").startWith(name).- Parameters:
name- jvm name we are looking for- Returns:
- if it's the requested JVM
-
isAndroidOpenJDK
public static boolean isAndroidOpenJDK()
Check if this JVM is an Android JVM based on OpenJDK.- Returns:
- if it's an Android version based on the OpenJDK. Will return false if this JVM isn't an Android JVM at all
-
isAfterJigsaw
public static boolean isAfterJigsaw()
Tells if the current JVM is running Java 9 or above- Returns:
- if the current JVM is Java 9 or above
-
isAfterJava11
public static boolean isAfterJava11()
Tells if the current JVM is running Java 11 or above- Returns:
- if the current JVM is Java 11 or above
-
isGoogleAppEngine
public static boolean isGoogleAppEngine()
-
-