Enum 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 17757 2018-11-13 20:41:13Z colin $
    Author:
    tlerios@marketcetera.com
    • Constructor Detail

      • OperatingSystem

        private OperatingSystem​(String javaName)
        Creates a new enumerated constant, associated with the given expected value for the os.name system 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 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.
      • 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.