java.lang.Object
java.lang.Enum<OS>
org.standardout.gradle.plugin.platform.internal.osdetect.OS
All Implemented Interfaces:
Serializable, Comparable<OS>, Constable

public enum OS extends Enum<OS>
Enum representing an OS and its underlying CPU architecture.
  • Enum Constant Details

    • WIN_x64

      public static final OS WIN_x64
    • WIN_x86

      public static final OS WIN_x86
    • LINUX_x64

      public static final OS LINUX_x64
    • LINUX_x86

      public static final OS LINUX_x86
    • MAC_x64

      public static final OS MAC_x64
  • Method Details

    • values

      public static OS[] 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 OS 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
    • isWindows

      public boolean isWindows()
    • isLinux

      public boolean isLinux()
    • isMac

      public boolean isMac()
    • isMacOrLinux

      public boolean isMacOrLinux()
    • winMacLinux

      public <T> T winMacLinux(T win, T mac, T linux)
      Returns the appropriate value depending on the OS.
    • getArch

      public Arch getArch()
      Returns the architecture of the given operating system.
    • getNative

      public static OS getNative()
      Returns the native OS: 32-bit JVM on 64-bit Windows returns OS.WIN_64.
    • getRunning

      public static OS getRunning()
      Returns the running OS: 32-bit JVM on 64-bit Windows returns OS.WIN_32.
    • unsupportedException

      public static UnsupportedOperationException unsupportedException(OS os)
      Returns an UnsupportedOperationException for the given OS.