public enum OperatingSystem extends Enum<OperatingSystem>
Modifier and Type | Method and Description |
---|---|
static boolean |
isLinux()
Checks if
System.getProperty("os.name") returns a value that contains "linux" (ignoring case). |
static boolean |
isMac()
Checks if
System.getProperty("os.name") returns a value that contains "mac" (ignoring case). |
static boolean |
isWindows()
Checks if
System.getProperty("os.name") returns a value that contains "windows" (ignoring case). |
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 LINUX
public static final OperatingSystem MAC
public static final OperatingSystem WINDOWS
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 boolean isLinux()
System.getProperty("os.name")
returns a value that contains "linux"
(ignoring case).true
if this is the case, false
otherwisepublic static boolean isMac()
System.getProperty("os.name")
returns a value that contains "mac"
(ignoring case).true
if this is the case, false
otherwisepublic static boolean isWindows()
System.getProperty("os.name")
returns a value that contains "windows"
(ignoring case).true
if this is the case, false
otherwiseCopyright © 2011–2017 aiticon GmbH. All rights reserved.