Enum OperatingSystem

    • 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
      • toOperatingSystem

        public static OperatingSystem toOperatingSystem()
        Determines the operating system your application is currently running on.
        Returns:
        The OperatingSystem being detected.
      • getVersion

        public String getVersion()
        Tries at best will to get a version number of the currently operating OS. Useful to get the OS version of the OperatingSystem enumeration returned by toOperatingSystem().
        Returns:
        The version number at best will, returns null if the the OperatingSystem enumeration on which this method is being called does not correspond to the actual operating OS for the executing machine.