org.opends.server.types
Enum OperatingSystem

java.lang.Object
  extended by java.lang.Enum<OperatingSystem>
      extended by org.opends.server.types.OperatingSystem
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<OperatingSystem>

@PublicAPI(stability=VOLATILE,
           mayInstantiate=false,
           mayExtend=false,
           mayInvoke=true)
public enum OperatingSystem
extends java.lang.Enum<OperatingSystem>

This class defines an enumeration that may be used to identify the operating system on which the JVM is running. NOTE: to share code this class is used in SetupUtils and should not contain any dependency with other classes (not even with classes in this package). If this class is modified to depend on other classes it will break the quicksetup. If this must be done, the references to this class in SetupUtils must be removed.


Enum Constant Summary
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.
UNKNOWN
          The value indicating an unknown operating system.
WINDOWS
          The value indicating the Windows operating system.
ZOS
          The value indicating the z/OS operating system.
 
Method Summary
static OperatingSystem forName(java.lang.String osName)
          Retrieves the operating system for the provided name.
static boolean isUNIXBased(OperatingSystem os)
          Indicates whether the provided operating system is UNIX-based.
 java.lang.String toString()
          Retrieves the human-readable name of this operating system.
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.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

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.


MACOS

public static final OperatingSystem MACOS
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.


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(java.lang.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:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

toString

public java.lang.String toString()
Retrieves the human-readable name of this operating system.

Overrides:
toString in class java.lang.Enum<OperatingSystem>
Returns:
The human-readable name for this operating system.

forName

public static OperatingSystem forName(java.lang.String osName)
Retrieves the operating system for the provided name. The name provided should come from the os.name system property.

Parameters:
osName - The name for which to retrieve the corresponding operating system.
Returns:
The operating system for the provided name.

isUNIXBased

public static boolean isUNIXBased(OperatingSystem os)
Indicates whether the provided operating system is UNIX-based. UNIX-based operating systems include Solaris, Linux, HP-UX, AIX, FreeBSD, and Mac OS X.

Parameters:
os - The operating system for which to make the determination.
Returns:
true if the provided operating system is UNIX-based, or false if not.