public enum Platform extends Enum<Platform>
Enum Constant and Description |
---|
ANDROID |
ANY
Never returned, but can be used to request a browser running on any operating system.
|
LINUX |
MAC |
UNIX
Many platforms have UNIX traits, amongst them LINUX, Solaris and BSD.
|
VISTA
For versions of Windows that "feel like" Windows Vista.
|
WIN8
For versions of Windows that "feel like" Windows 8.
|
WIN8_1 |
WINDOWS
Never returned, but can be used to request a browser running on any version of Windows.
|
XP
For versions of Windows that "feel like" Windows XP.
|
Modifier and Type | Method and Description |
---|---|
static Platform |
extractFromSysProperty(String osName)
Extracts platforms based on system properties in Java and uses a heuristic to determine the
most likely operating system.
|
static Platform |
extractFromSysProperty(String osName,
String osVersion)
Extracts platforms based on system properties in Java and uses a heuristic to determine the
most likely operating system.
|
Platform |
family()
Returns a platform that represents a family for the current platform.
|
static Platform |
getCurrent()
Get current platform (not necessarily the same as operating system).
|
int |
getMajorVersion()
Returns the major version of this platform.
|
int |
getMinorVersion()
Returns the minor version of this platform.
|
String[] |
getPartOfOsName() |
boolean |
is(Platform compareWith)
Heuristic for comparing two platforms.
|
static Platform |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Platform[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Platform WINDOWS
public static final Platform XP
public static final Platform VISTA
public static final Platform WIN8
public static final Platform WIN8_1
public static final Platform MAC
public static final Platform UNIX
public static final Platform LINUX
public static final Platform ANDROID
public static final Platform ANY
public static Platform[] values()
for (Platform c : Platform.values()) System.out.println(c);
public static Platform valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic String[] getPartOfOsName()
public static Platform getCurrent()
public static Platform extractFromSysProperty(String osName)
osName
- the operating system name to determine the platform ofpublic static Platform extractFromSysProperty(String osName, String osVersion)
osName
- the operating system name to determine the platform ofosVersion
- the operating system version to determine the platform ofpublic boolean is(Platform compareWith)
compareWith
- the platform to compare withpublic Platform family()
public int getMajorVersion()
public int getMinorVersion()
Copyright © 2014. All rights reserved.