Enum EProcessorArchitecture

java.lang.Object
java.lang.Enum<EProcessorArchitecture>
com.helger.commons.system.EProcessorArchitecture
All Implemented Interfaces:
Serializable, Comparable<EProcessorArchitecture>, java.lang.constant.Constable

public enum EProcessorArchitecture extends Enum<EProcessorArchitecture>
Enum for representing the current processor architecture. Works only on Sun JVMs using the proprietary system property sun.arch.data.model.
Author:
Philip Helger
  • Enum Constant Details

  • Method Details

    • values

      public static EProcessorArchitecture[] 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 EProcessorArchitecture 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
    • getBits

      public int getBits()
      Returns:
      The number of bits of this architecture. May be CGlobal.ILLEGAL_UINT for the unknown architecture.
    • getBytes

      public int getBytes()
      Returns:
      The number of bytes of this architecture (=bits/8). May be CGlobal.ILLEGAL_UINT for the unknown architecture.
    • getCurrentArchitectureBits

      @CheckForSigned public static int getCurrentArchitectureBits()
      Returns:
      The number of bits in the current architecture or CGlobal.ILLEGAL_UINT if this is undetermined.
    • forBits

      @Nonnull public static EProcessorArchitecture forBits(int nBits)
      Get the processor architecture based on the passed number of bits.
      Parameters:
      nBits - The number of bits to get the processor architecture from.
      Returns:
      UNKNOWN if no processor architecture could be determined.
    • getCurrentArchitecture

      @Nonnull public static EProcessorArchitecture getCurrentArchitecture()
      Returns:
      The current processor architecture if running inside a Sun JVM. If no processor architecture could be determined, UNKNOWN is returned and never null.