Enum EOperatingSystem

java.lang.Object
java.lang.Enum<EOperatingSystem>
com.helger.commons.system.EOperatingSystem
All Implemented Interfaces:
IHasDisplayName, Serializable, Comparable<EOperatingSystem>, java.lang.constant.Constable

public enum EOperatingSystem extends Enum<EOperatingSystem> implements IHasDisplayName
This enumeration is used to determine the currently running Operating system.
Author:
Philip Helger
  • Enum Constant Details

    • AIX

      public static final EOperatingSystem AIX
      The value indicating the AIX operating system.
    • FREEBSD

      public static final EOperatingSystem FREEBSD
      The value indicating the FreeBSD operating system.
    • HPUX

      public static final EOperatingSystem HPUX
      The value indicating the HP-UX operating system.
    • LINUX

      public static final EOperatingSystem LINUX
      The value indicating the Linux operating system.
    • MACOS

      public static final EOperatingSystem MACOS
      The value indicating the Mac OS X operating system.
    • SOLARIS

      public static final EOperatingSystem SOLARIS
      The value indicating the Solaris operating system.
    • WINDOWS

      public static final EOperatingSystem WINDOWS
      The value indicating the Windows operating system.
    • ZOS

      public static final EOperatingSystem ZOS
      The value indicating the z/OS operating system.
    • UNKNOWN

      public static final EOperatingSystem UNKNOWN
      The value indicating an unknown operating system.
  • Method Details

    • values

      public static EOperatingSystem[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static EOperatingSystem 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
    • getDisplayName

      @Nonnull @Nonempty public String getDisplayName()
      Specified by:
      getDisplayName in interface IHasDisplayName
      Returns:
      The display name of this object. Should never be null.
    • isUnixBased

      public boolean isUnixBased()
      Indicates whether the provided operating system is UNIX-based. UNIX-based operating systems include:
      • AIX
      • FreeBSD
      • HP-UX
      • Linux
      • Mac OS X
      • Solaris
      Returns:
      true if the provided operating system is UNIX-based, or false if not.
    • isWindowsBased

      public boolean isWindowsBased()
      Indicates whether the provided operating system is Windows-based. Windows-based operating systems include:
      • Windows
      Returns:
      true if the provided operating system is Windows-based, or false if not.
    • isMacOSBased

      public boolean isMacOSBased()
      Indicates whether the provided operating system is MacOS-based. MacOS-based operating systems include:
      • MacOS
      Returns:
      true if the provided operating system is MacOS-based, or false if not.
    • isCurrentOS

      public boolean isCurrentOS()
      Returns:
      true if the this OS is the current OS.
    • getNewLineMode

      @Nonnull public ENewLineMode getNewLineMode()
      Returns:
      The newline mode matching this operating system.
    • forName

      @Nonnull public static EOperatingSystem forName(@Nullable String sOSName)
      Retrieves the operating system for the provided name. The name provided should come from the os.name system property.
      Parameters:
      sOSName - The name for which to retrieve the corresponding operating system.
      Returns:
      The operating system for the provided name. If the operating system could not be determined, UNKNOWN is returned and never null.
    • getCurrentOS

      @Nonnull public static EOperatingSystem getCurrentOS()
      Returns:
      The current OS. Never null.
    • getCurrentOSName

      @Nullable public static String getCurrentOSName()
      Returns:
      The name of the current operating system.
    • getCurrentOSVersion

      @Nullable public static String getCurrentOSVersion()
      Returns:
      The version of the current operating system.