public enum OS extends Enum<OS>
Enum Constant and Description |
---|
LINUX_x64 |
LINUX_x86 |
MAC_x64 |
WIN_x64 |
WIN_x86 |
Modifier and Type | Method and Description |
---|---|
Arch |
getArch()
Returns the architecture of the given operating system.
|
static OS |
getNative()
Returns the native OS: 32-bit JVM on 64-bit Windows returns OS.WIN_64.
|
static OS |
getRunning()
Returns the running OS: 32-bit JVM on 64-bit Windows returns OS.WIN_32.
|
boolean |
isLinux() |
boolean |
isMac() |
boolean |
isMacOrLinux() |
boolean |
isWindows() |
static UnsupportedOperationException |
unsupportedException(OS os)
Returns an UnsupportedOperationException for the given OS.
|
static OS |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static OS[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
<T> T |
winMacLinux(T win,
T mac,
T linux)
Returns the appropriate value depending on the OS.
|
public static final OS WIN_x64
public static final OS WIN_x86
public static final OS LINUX_x64
public static final OS LINUX_x86
public static final OS MAC_x64
public static OS[] values()
for (OS c : OS.values()) System.out.println(c);
public static OS 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 boolean isWindows()
public boolean isLinux()
public boolean isMac()
public boolean isMacOrLinux()
public <T> T winMacLinux(T win, T mac, T linux)
public Arch getArch()
public static OS getNative()
public static OS getRunning()
public static UnsupportedOperationException unsupportedException(OS os)