public enum OperatingSystem extends Enum<OperatingSystem>
os.name system property for each operating system is
associated with its corresponding enumerated value.| Enum Constant and Description |
|---|
AIX |
DARWIN |
FREEBSD |
HPUX |
LINUX |
MAC_OS_X |
SOLARIS |
UNKNOWN |
WINDOWS_2000 |
WINDOWS_2003 |
WINDOWS_7 |
WINDOWS_CE |
WINDOWS_VISTA |
WINDOWS_XP |
| Modifier and Type | Field and Description |
|---|---|
static String |
LABEL_UNIX
The label attached to UNIX variants by
toString(). |
static String |
LABEL_WIN32
The label attached to Windows variants by
toString(). |
static OperatingSystem |
LOCAL
The operating system on which this JVM is running.
|
| Modifier and Type | Method and Description |
|---|---|
static OperatingSystem |
get(String javaName)
Returns the enumerated constant associated with the given
expected value for the
os.name system
property. |
String |
getJavaName()
Returns the expected value of the os.name property
for the receiver.
|
boolean |
isUnix()
Returns true if the receiver is a Unix variant.
|
boolean |
isWin32()
Returns true if the receiver is a Windows variant.
|
String |
toString() |
static OperatingSystem |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static OperatingSystem[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final OperatingSystem WINDOWS_2000
public static final OperatingSystem WINDOWS_2003
public static final OperatingSystem WINDOWS_CE
public static final OperatingSystem WINDOWS_XP
public static final OperatingSystem WINDOWS_VISTA
public static final OperatingSystem WINDOWS_7
public static final OperatingSystem MAC_OS_X
public static final OperatingSystem DARWIN
public static final OperatingSystem FREEBSD
public static final OperatingSystem LINUX
public static final OperatingSystem SOLARIS
public static final OperatingSystem AIX
public static final OperatingSystem HPUX
public static final OperatingSystem UNKNOWN
public static final String LABEL_WIN32
toString().public static final String LABEL_UNIX
toString().public static final OperatingSystem LOCAL
public static OperatingSystem[] values()
for (OperatingSystem c : OperatingSystem.values()) System.out.println(c);
public static OperatingSystem 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 static OperatingSystem get(String javaName)
os.name system
property. Returns UNKNOWN if there is no match;
returns the first (in order or declaration) match if there is
more than one match.javaName - The expected property value.public String toString()
toString in class Enum<OperatingSystem>public String getJavaName()
UNKNOWN.public boolean isWin32()
public boolean isUnix()
Copyright © 2015. All Rights Reserved.