public enum OperatingSystem extends java.lang.Enum<OperatingSystem>
Contains functions for Operating System lookup, and platform specific actions.
Created by covers1624 on 11/11/21.
| Enum Constant and Description |
|---|
FREEBSD |
LINUX |
MACOS |
SOLARIS |
UNKNOWN
Unknown OperatingSystem.
|
WINDOWS |
| Modifier and Type | Method and Description |
|---|---|
static OperatingSystem |
current()
Returns the current
OperatingSystem. |
java.lang.String |
exeSuffix(java.lang.String file)
Appends the system specific common executable suffix to a file name.
|
boolean |
isFreebsd() |
boolean |
isLinux() |
boolean |
isMacos() |
boolean |
isSolaris() |
boolean |
isUnixLike()
|
boolean |
isWindows() |
static OperatingSystem |
parse(java.lang.String name)
Parse an Operating System string.
|
static OperatingSystem |
valueOf(java.lang.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
public static final OperatingSystem MACOS
public static final OperatingSystem LINUX
public static final OperatingSystem SOLARIS
public static final OperatingSystem FREEBSD
public static final OperatingSystem UNKNOWN
UnsupportedOperationException's.public static OperatingSystem[] values()
for (OperatingSystem c : OperatingSystem.values()) System.out.println(c);
public static OperatingSystem valueOf(java.lang.String name)
name - the name of the enum constant to be returned.java.lang.IllegalArgumentException - if this enum type has no constant with the specified namejava.lang.NullPointerException - if the argument is nullpublic static OperatingSystem current()
OperatingSystem.OperatingSystem.public static OperatingSystem parse(java.lang.String name)
This method will support the result of System.getProperty(java.lang.String) with
the key of os.name.
name - The name to parse.OperatingSystem. Will return UNKNOWN if the
Operating System is not known.public boolean isWindows()
WINDOWSpublic boolean isMacos()
MACOSpublic boolean isLinux()
LINUXpublic boolean isSolaris()
SOLARISpublic boolean isFreebsd()
FREEBSDpublic boolean isUnixLike()
public java.lang.String exeSuffix(java.lang.String file)
file - The file name to append to.