Enum OperatingSystem

java.lang.Object
java.lang.Enum<OperatingSystem>
org.refcodes.runtime.OperatingSystem
All Implemented Interfaces:
Serializable, Comparable<OperatingSystem>, java.lang.constant.Constable

public enum OperatingSystem extends Enum<OperatingSystem>
Enumeration with the (supported) operating systems.
Author:
steiner
  • Enum Constant Details

  • Method Details

    • values

      public static OperatingSystem[] 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 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.