Package com.helger.commons.system
Enum EOperatingSystem
- All Implemented Interfaces:
IHasDisplayName,Serializable,Comparable<EOperatingSystem>,java.lang.constant.Constable
This enumeration is used to determine the currently running Operating system.
- Author:
- Philip Helger
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe value indicating the AIX operating system.The value indicating the FreeBSD operating system.The value indicating the HP-UX operating system.The value indicating the Linux operating system.The value indicating the Mac OS X operating system.The value indicating the Solaris operating system.The value indicating an unknown operating system.The value indicating the Windows operating system.The value indicating the z/OS operating system. -
Method Summary
Modifier and TypeMethodDescriptionstatic EOperatingSystemRetrieves the operating system for the provided name.static EOperatingSystemstatic Stringstatic StringbooleanbooleanIndicates whether the provided operating system is MacOS-based.booleanIndicates whether the provided operating system is UNIX-based.booleanIndicates whether the provided operating system is Windows-based.static EOperatingSystemReturns the enum constant of this type with the specified name.static EOperatingSystem[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
AIX
The value indicating the AIX operating system. -
FREEBSD
The value indicating the FreeBSD operating system. -
HPUX
The value indicating the HP-UX operating system. -
LINUX
The value indicating the Linux operating system. -
MACOS
The value indicating the Mac OS X operating system. -
SOLARIS
The value indicating the Solaris operating system. -
WINDOWS
The value indicating the Windows operating system. -
ZOS
The value indicating the z/OS operating system. -
UNKNOWN
The value indicating an unknown operating system.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException- if the argument is null
-
getDisplayName
- Specified by:
getDisplayNamein interfaceIHasDisplayName- Returns:
- The display name of this object. Should never be
null.
-
isUnixBased
public boolean isUnixBased()Indicates whether the provided operating system is UNIX-based. UNIX-based operating systems include:- AIX
- FreeBSD
- HP-UX
- Linux
- Mac OS X
- Solaris
- Returns:
trueif the provided operating system is UNIX-based, orfalseif not.
-
isWindowsBased
public boolean isWindowsBased()Indicates whether the provided operating system is Windows-based. Windows-based operating systems include:- Windows
- Returns:
trueif the provided operating system is Windows-based, orfalseif not.
-
isMacOSBased
public boolean isMacOSBased()Indicates whether the provided operating system is MacOS-based. MacOS-based operating systems include:- MacOS
- Returns:
trueif the provided operating system is MacOS-based, orfalseif not.
-
isCurrentOS
public boolean isCurrentOS()- Returns:
trueif the this OS is the current OS.
-
getNewLineMode
- Returns:
- The newline mode matching this operating system.
-
forName
Retrieves the operating system for the provided name. The name provided should come from theos.namesystem property.- Parameters:
sOSName- The name for which to retrieve the corresponding operating system.- Returns:
- The operating system for the provided name. If the operating system
could not be determined,
UNKNOWNis returned and nevernull.
-
getCurrentOS
- Returns:
- The current OS. Never
null.
-
getCurrentOSName
- Returns:
- The name of the current operating system.
-
getCurrentOSVersion
- Returns:
- The version of the current operating system.
-