Enum Class OSFamily

java.lang.Object
java.lang.Enum<OSFamily>
com.dua3.gradle.jdkprovider.types.OSFamily
All Implemented Interfaces:
Serializable, Comparable<OSFamily>, Constable

@NullMarked public enum OSFamily extends Enum<OSFamily>
Enum representing various families of operating systems. It provides utilities for determining the current operating system and parsing a string representation of an operating system name into an OSFamily instance.
  • Nested Class Summary

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

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    Represents the AIX operating system family.
    Represents the FreeBSD operating system family.
    Represents the Linux operating system family.
    Represents the macOS family of operating systems.
    Represents the QNX operating system family.
    Enumeration constant representing the Solaris operating system.
    Represents the Microsoft Windows family of operating systems.
  • Method Summary

    Modifier and Type
    Method
    Description
    static OSFamily
    Determines the current operating system based on the system property "os.name".
    static OSFamily
    parse(String osName)
    Parses the provided operating system name into an OSFamily instance.
    Returns the name of this enum constant converted to lowercase.
    static OSFamily
    Returns the enum constant of this class with the specified name.
    static OSFamily[]
    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

    • AIX

      public static final OSFamily AIX
      Represents the AIX operating system family.
    • FREE_BSD

      public static final OSFamily FREE_BSD
      Represents the FreeBSD operating system family.
    • LINUX

      public static final OSFamily LINUX
      Represents the Linux operating system family.
    • MACOS

      public static final OSFamily MACOS
      Represents the macOS family of operating systems.
    • QNX

      public static final OSFamily QNX
      Represents the QNX operating system family.
    • SOLARIS

      public static final OSFamily SOLARIS
      Enumeration constant representing the Solaris operating system.
    • WINDOWS

      public static final OSFamily WINDOWS
      Represents the Microsoft Windows family of operating systems.
  • Method Details

    • values

      public static OSFamily[] 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 OSFamily 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
    • toString

      public String toString()
      Returns the name of this enum constant converted to lowercase.
      Overrides:
      toString in class Enum<OSFamily>
      Returns:
      the lowercase string representation of this enum constant
    • current

      public static OSFamily current()
      Determines the current operating system based on the system property "os.name".
      Returns:
      the OSFamily corresponding to the current operating system.
      Throws:
      IllegalStateException - if the operating system is unknown or unrecognized.
    • parse

      public static OSFamily parse(String osName)
      Parses the provided operating system name into an OSFamily instance.

      This method matches the given operating system name against predefined patterns to determine its corresponding OSFamily.

      Parameters:
      osName - the name of the operating system, typically obtained from system properties or other sources, e.g., "os.name". It is case-insensitive.
      Returns:
      the matching OSFamily instance for the given operating system name
      Throws:
      IllegalStateException - if the operating system name does not match any known OSFamily