Enum Class OperatingSystem

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

public enum OperatingSystem extends Enum<OperatingSystem> implements org.refcodes.mixin.DetectedAccessor
Enumeration with the (supported) operating systems.
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>

    Nested classes/interfaces inherited from interface org.refcodes.mixin.DetectedAccessor

    org.refcodes.mixin.DetectedAccessor.DetectedBuilder<B extends org.refcodes.mixin.DetectedAccessor.DetectedBuilder<B>>, org.refcodes.mixin.DetectedAccessor.DetectedMutator, org.refcodes.mixin.DetectedAccessor.DetectedProperty
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
     
    Unix / Linux / BSD like operating system.
    Unknown operating system.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Tries at best will to get a version number of the currently operating OS.
    boolean
    Determines whether this enumeration represents the current OperatingSystem (e.g. this OS has be detected to be running currently).
    Determines the operating system your application is currently running on.
    Returns the enum constant of this class with the specified name.
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

  • Method Details

    • values

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

      public static OperatingSystem valueOf(String name)
      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 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.
    • isDetected

      public boolean isDetected()
      Determines whether this enumeration represents the current OperatingSystem (e.g. this OS has be detected to be running currently).
      Specified by:
      isDetected in interface org.refcodes.mixin.DetectedAccessor
      Returns:
      True in case this enumeration (most probably) represents this machine's OperatingSystem.