Enum Class OS
- All Implemented Interfaces:
Serializable,Comparable<OS>,Constable
Enum representing an OS and its underlying CPU architecture.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptiongetArch()Returns the architecture of the given operating system.static OSReturns the native OS: 32-bit JVM on 64-bit Windows returns OS.WIN_64.static OSReturns the running OS: 32-bit JVM on 64-bit Windows returns OS.WIN_32.booleanisLinux()booleanisMac()booleanbooleanReturns an UnsupportedOperationException for the given OS.static OSReturns the enum constant of this class with the specified name.static OS[]values()Returns an array containing the constants of this enum class, in the order they are declared.<T> TwinMacLinux(T win, T mac, T linux) Returns the appropriate value depending on the OS.
-
Enum Constant Details
-
WIN_x64
-
WIN_x86
-
LINUX_x64
-
LINUX_x86
-
MAC_x64
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
isWindows
public boolean isWindows() -
isLinux
public boolean isLinux() -
isMac
public boolean isMac() -
isMacOrLinux
public boolean isMacOrLinux() -
winMacLinux
public <T> T winMacLinux(T win, T mac, T linux) Returns the appropriate value depending on the OS. -
getArch
Returns the architecture of the given operating system. -
getNative
Returns the native OS: 32-bit JVM on 64-bit Windows returns OS.WIN_64. -
getRunning
Returns the running OS: 32-bit JVM on 64-bit Windows returns OS.WIN_32. -
unsupportedException
Returns an UnsupportedOperationException for the given OS.
-