Enum Class SystemArchitecture

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

@NullMarked public enum SystemArchitecture extends Enum<SystemArchitecture>
Represents the different types of system architectures and provides utility methods for working with architecture-related data.

Each enumeration value is associated with a list of aliases that can be used to identify the architecture. This allows flexible mapping from architecture strings to the corresponding enumeration value.

  • Enum Constant Details

    • AARCH32

      public static final SystemArchitecture AARCH32
      Represents the AARCH32 system architecture, also known as ARM 32-bit architecture.
    • AARCH64

      public static final SystemArchitecture AARCH64
      Represents the 64-bit ARM architecture, commonly known as `aarch64` or `arm64`.
    • X64

      public static final SystemArchitecture X64
      Represents the x86_64 (64-bit) system architecture with common aliases.
    • X86_32

      public static final SystemArchitecture X86_32
      Represents the 32-bit x86 system architecture.
  • Method Details

    • values

      public static SystemArchitecture[] 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 SystemArchitecture 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
    • aliases

      public List<String> aliases()
      Retrieves the list of alias names associated with the system architecture.
      Returns:
      a list of alias strings used to identify this system architecture
    • toString

      public String toString()
      Returns the lowercase string representation of the enumeration constant's name.
      Overrides:
      toString in class Enum<SystemArchitecture>
      Returns:
      the name of the enumeration constant in lowercase using the root locale.
    • current

      public static SystemArchitecture current()
      Returns the current system architecture based on the `os.arch` system property.
      Returns:
      the enum value referring to the current system architecture
    • parse

      public static SystemArchitecture parse(String osArch)
      Parses the input string representing an operating system architecture and returns the corresponding SystemArchitecture enumeration value.

      The input string is normalized by converting it to lowercase and trimming any leading or trailing whitespace. It is then compared against known aliases for each architecture. If a match is found, the corresponding SystemArchitecture value is returned. Otherwise, an IllegalStateException is thrown.

      Parameters:
      osArch - the operating system architecture as a string
      Returns:
      the corresponding SystemArchitecture enumeration value
      Throws:
      IllegalStateException - if the input string does not match any known architecture aliases