org.marketcetera.util.misc
Enum OperatingSystem

java.lang.Object
  extended by java.lang.Enum<OperatingSystem>
      extended by org.marketcetera.util.misc.OperatingSystem
All Implemented Interfaces:
Serializable, Comparable<OperatingSystem>

public enum OperatingSystem
extends Enum<OperatingSystem>

An enumeration of operating systems. The expected value of the os.name system property for each operating system is associated with its corresponding enumerated value.

Since:
0.5.0
Version:
$Id: OperatingSystem.java 16154 2012-07-14 16:34:05Z colin $
Author:
tlerios@marketcetera.com

Enum Constant Summary
AIX
           
DARWIN
           
FREEBSD
           
HPUX
           
LINUX
           
MAC_OS_X
           
SOLARIS
           
UNKNOWN
           
WINDOWS_2000
           
WINDOWS_2003
           
WINDOWS_7
           
WINDOWS_CE
           
WINDOWS_VISTA
           
WINDOWS_XP
           
 
Field Summary
static String LABEL_UNIX
          The label attached to UNIX variants by toString().
static String LABEL_WIN32
          The label attached to Windows variants by toString().
static OperatingSystem LOCAL
          The operating system on which this JVM is running.
 
Method Summary
static OperatingSystem get(String javaName)
          Returns the enumerated constant associated with the given expected value for the os.name system property.
 String getJavaName()
          Returns the expected value of the os.name property for the receiver.
 boolean isUnix()
          Returns true if the receiver is a Unix variant.
 boolean isWin32()
          Returns true if the receiver is a Windows variant.
 String toString()
           
static OperatingSystem valueOf(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

WINDOWS_2000

public static final OperatingSystem WINDOWS_2000

WINDOWS_2003

public static final OperatingSystem WINDOWS_2003

WINDOWS_CE

public static final OperatingSystem WINDOWS_CE

WINDOWS_XP

public static final OperatingSystem WINDOWS_XP

WINDOWS_VISTA

public static final OperatingSystem WINDOWS_VISTA

WINDOWS_7

public static final OperatingSystem WINDOWS_7

MAC_OS_X

public static final OperatingSystem MAC_OS_X

DARWIN

public static final OperatingSystem DARWIN

FREEBSD

public static final OperatingSystem FREEBSD

LINUX

public static final OperatingSystem LINUX

SOLARIS

public static final OperatingSystem SOLARIS

AIX

public static final OperatingSystem AIX

HPUX

public static final OperatingSystem HPUX

UNKNOWN

public static final OperatingSystem UNKNOWN
Field Detail

LABEL_WIN32

public static final String LABEL_WIN32
The label attached to Windows variants by toString().

See Also:
Constant Field Values

LABEL_UNIX

public static final String LABEL_UNIX
The label attached to UNIX variants by toString().

See Also:
Constant Field Values

LOCAL

public static final OperatingSystem LOCAL
The operating system on which this JVM is running.

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 name
NullPointerException - if the argument is null

get

public static OperatingSystem get(String javaName)
Returns the enumerated constant associated with the given expected value for the os.name system property. Returns UNKNOWN if there is no match; returns the first (in order or declaration) match if there is more than one match.

Parameters:
javaName - The expected property value.
Returns:
The enumerated constant.

toString

public String toString()
Overrides:
toString in class Enum<OperatingSystem>

getJavaName

public String getJavaName()
Returns the expected value of the os.name property for the receiver.

Returns:
The value. It may be null for UNKNOWN.

isWin32

public boolean isWin32()
Returns true if the receiver is a Windows variant.

Returns:
True if so.

isUnix

public boolean isUnix()
Returns true if the receiver is a Unix variant.

Returns:
True if so.


Copyright © 2012. All Rights Reserved.