@API(status=STABLE,
since="5.1")
public enum OS
extends Enum<OS>
If the current operating system cannot be detected — for example,
if the os.name JVM system property is undefined — then none
of the constants defined in this enum will be considered to be the
current operating system.
EnabledOnOs,
DisabledOnOs| Enum Constant and Description |
|---|
LINUX
Linux-based operating system.
|
MAC
Apple Macintosh operating system (e.g., macOS).
|
OTHER
|
SOLARIS
Oracle Solaris operating system.
|
WINDOWS
Microsoft Windows operating system.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
isCurrentOs() |
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.
|
public static final OS LINUX
public static final OS MAC
public static final OS SOLARIS
public static final OS WINDOWS
public static final OS OTHER
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 isCurrentOs()
true if this OS is known to be the
operating system on which the current JVM is executingCopyright © 2020. All rights reserved.