Package com.forgerock.opendj.util
Enum OperatingSystem
- java.lang.Object
-
- java.lang.Enum<OperatingSystem>
-
- com.forgerock.opendj.util.OperatingSystem
-
- All Implemented Interfaces:
Serializable,Comparable<OperatingSystem>
public enum OperatingSystem extends Enum<OperatingSystem>
This class defines an enumeration that may be used to identify the operating system on which the JVM is running.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description AIXThe value indicating the AIX operating system.FREEBSDThe value indicating the FreeBSD operating system.HPUXThe value indicating the HP-UX operating system.LINUXThe value indicating the Linux operating system.MACOSXThe value indicating the Mac OS X operating system.SOLARISThe value indicating the Solaris operating system.UNKNOWNThe value indicating an unknown operating system.WINDOWSThe value indicating the Windows operating system.WINDOWS_SERVER_2008The value indicating the Windows Server 2008 operating system.WINDOWS_VISTAThe value indicating the Windows Vista operating system.WINDOWS7The value indicating the Windows 7 operating system.ZOSThe value indicating the z/OS operating system.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static OperatingSystemforName(String osName)Retrieves the operating system for the provided name.static OperatingSystemgetOperatingSystem()Returns the operating system on which the JVM is running.static booleanhasUAC()Indicates whether the underlying operating system has UAC (User Access Control).static booleanisMacOS()Returnstrueif we are running under Mac OS andfalseotherwise.static booleanisUnix()Returnstrueif we are running under Unix andfalseotherwise.static booleanisUnixBased()Returnstrueif the OS is Unix based.static booleanisUnknown()Returnstrueif the OS is Unknown.static booleanisVista()Indicates whether the underlying operating system is Windows Vista.static booleanisWindows()Indicates whether the underlying operating system is a Windows variant.static booleanisWindows2008()Indicates whether the underlying operating system is Windows 2008.static booleanisWindows7()Indicates whether the underlying operating system is Windows 7.StringtoString()Retrieves the human-readable name of this operating system.static OperatingSystemvalueOf(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.
-
-
-
Enum Constant Detail
-
AIX
public static final OperatingSystem AIX
The value indicating the AIX operating system.
-
FREEBSD
public static final OperatingSystem FREEBSD
The value indicating the FreeBSD operating system.
-
HPUX
public static final OperatingSystem HPUX
The value indicating the HP-UX operating system.
-
LINUX
public static final OperatingSystem LINUX
The value indicating the Linux operating system.
-
MACOSX
public static final OperatingSystem MACOSX
The value indicating the Mac OS X operating system.
-
SOLARIS
public static final OperatingSystem SOLARIS
The value indicating the Solaris operating system.
-
WINDOWS
public static final OperatingSystem WINDOWS
The value indicating the Windows operating system.
-
WINDOWS7
public static final OperatingSystem WINDOWS7
The value indicating the Windows 7 operating system.
-
WINDOWS_VISTA
public static final OperatingSystem WINDOWS_VISTA
The value indicating the Windows Vista operating system.
-
WINDOWS_SERVER_2008
public static final OperatingSystem WINDOWS_SERVER_2008
The value indicating the Windows Server 2008 operating system.
-
ZOS
public static final OperatingSystem ZOS
The value indicating the z/OS operating system.
-
UNKNOWN
public static final OperatingSystem UNKNOWN
The value indicating an unknown operating system.
-
-
Method Detail
-
values
public static OperatingSystem[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (OperatingSystem c : OperatingSystem.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static OperatingSystem valueOf(String name)
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
-
toString
public String toString()
Retrieves the human-readable name of this operating system.- Overrides:
toStringin classEnum<OperatingSystem>- Returns:
- The human-readable name for this operating system.
-
forName
public static OperatingSystem forName(String osName)
Retrieves the operating system for the provided name.- Parameters:
osName- The name for which to retrieve the corresponding operating system.- Returns:
- The operating system for the provided name.
-
getOperatingSystem
public static OperatingSystem getOperatingSystem()
Returns the operating system on which the JVM is running.- Returns:
- The operating system on which the JVM is running
-
isWindows
public static boolean isWindows()
Indicates whether the underlying operating system is a Windows variant.- Returns:
trueif the underlying operating system is a Windows variant, orfalseif not.
-
isVista
public static boolean isVista()
Indicates whether the underlying operating system is Windows Vista.- Returns:
trueif the underlying operating system is Windows Vista, orfalseif not.
-
isWindows2008
public static boolean isWindows2008()
Indicates whether the underlying operating system is Windows 2008.- Returns:
trueif the underlying operating system is Windows 2008, orfalseif not.
-
isWindows7
public static boolean isWindows7()
Indicates whether the underlying operating system is Windows 7.- Returns:
trueif the underlying operating system is Windows 7, orfalseif not.
-
isMacOS
public static boolean isMacOS()
Returnstrueif we are running under Mac OS andfalseotherwise.- Returns:
trueif we are running under Mac OS andfalseotherwise.
-
isUnix
public static boolean isUnix()
Returnstrueif we are running under Unix andfalseotherwise.- Returns:
trueif we are running under Unix andfalseotherwise.
-
isUnixBased
public static boolean isUnixBased()
Returnstrueif the OS is Unix based.- Returns:
trueif the OS is Unix based.
-
isUnknown
public static boolean isUnknown()
Returnstrueif the OS is Unknown.- Returns:
trueif the OS is Unknown.
-
hasUAC
public static boolean hasUAC()
Indicates whether the underlying operating system has UAC (User Access Control).- Returns:
trueif the underlying operating system has UAC (User Access Control), orfalseif not.
-
-