- All Implemented Interfaces:
Serializable
,Comparable<OS>
,Constable
Enumeration of common operating systems used for testing Java applications.
If the current operating system cannot be detected — for example,
if the os.name
JVM system property is undefined — then none
of the constants defined in this enum will be considered to be the
current operating system.
- Since:
- 5.1
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionIBM AIX operating system.FreeBSD operating system.Linux-based operating system.Apple Macintosh operating system (e.g., macOS).OpenBSD operating system.Oracle Solaris operating system.Microsoft Windows operating system. -
Method Summary
-
Enum Constant Details
-
AIX
IBM AIX operating system.- Since:
- 5.3
-
FREEBSD
FreeBSD operating system.- Since:
- 5.9
-
LINUX
Linux-based operating system. -
MAC
Apple Macintosh operating system (e.g., macOS). -
OPENBSD
OpenBSD operating system.- Since:
- 5.9
-
SOLARIS
Oracle Solaris operating system. -
WINDOWS
Microsoft Windows operating system. -
OTHER
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException
- if the argument is null
-
current
Get the current operating system.- Since:
- 5.9
-
isCurrentOs
public boolean isCurrentOs()- Returns:
true
if thisOS
is known to be the operating system on which the current JVM is executing
-