Package org.marketcetera.util.misc
Enum OperatingSystem
- java.lang.Object
-
- java.lang.Enum<OperatingSystem>
-
- 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 theos.namesystem property for each operating system is associated with its corresponding enumerated value.- Since:
- 0.5.0
- Version:
- $Id: OperatingSystem.java 17757 2018-11-13 20:41:13Z colin $
- Author:
- tlerios@marketcetera.com
-
-
Enum Constant Summary
Enum Constants Enum Constant Description AIXDARWINFREEBSDHPUXLINUXMAC_OS_XSOLARISUNKNOWNWINDOWS_2000WINDOWS_2003WINDOWS_7WINDOWS_CEWINDOWS_VISTAWINDOWS_XP
-
Field Summary
Fields Modifier and Type Field Description static StringLABEL_UNIXThe label attached to UNIX variants bytoString().static StringLABEL_WIN32The label attached to Windows variants bytoString().static OperatingSystemLOCALThe operating system on which this JVM is running.private StringmJavaName
-
Constructor Summary
Constructors Modifier Constructor Description privateOperatingSystem(String javaName)Creates a new enumerated constant, associated with the given expected value for theos.namesystem property.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static OperatingSystemget(String javaName)Returns the enumerated constant associated with the given expected value for theos.namesystem property.StringgetJavaName()Returns the expected value of theos.nameproperty for the receiver.booleanisUnix()Returns true if the receiver is a Unix variant.booleanisWin32()Returns true if the receiver is a Windows variant.StringtoString()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
-
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 bytoString().- See Also:
- Constant Field Values
-
LABEL_UNIX
public static final String LABEL_UNIX
The label attached to UNIX variants bytoString().- See Also:
- Constant Field Values
-
LOCAL
public static final OperatingSystem LOCAL
The operating system on which this JVM is running.
-
mJavaName
private final String mJavaName
-
-
Constructor Detail
-
OperatingSystem
private OperatingSystem(String javaName)
Creates a new enumerated constant, associated with the given expected value for theos.namesystem property.- Parameters:
javaName- The expected property value.
-
-
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
-
get
public static OperatingSystem get(String javaName)
Returns the enumerated constant associated with the given expected value for theos.namesystem property. ReturnsUNKNOWNif 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:
toStringin classEnum<OperatingSystem>
-
getJavaName
public String getJavaName()
Returns the expected value of theos.nameproperty 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.
-
-