Package io.smallrye.common.cpu
Enum CPU
- java.lang.Object
-
- java.lang.Enum<CPU>
-
- io.smallrye.common.cpu.CPU
-
- All Implemented Interfaces:
Serializable,Comparable<CPU>
public enum CPU extends Enum<CPU>
Enumerated type for CPU types.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description aarch64armmipsmips64mips64elmipselppcppc32ppc32leppcleriscvunknown32An unknown 32-bit little-endian CPU.unknown32beAn unknown 32-bit big-endian CPU.unknown64An unknown 64-bit little-endian CPU.unknown64beAn unknown 64-bit big-endian CPU.wasm32x64x86
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<String>aliases()static CPUforName(String name)Names are compared case-insensitively.static Optional<CPU>forNameOpt(String name)Names are compared case-insensitively.static CPUforNameOrNull(String name)Names are compared case-insensitively.static CPUhost()booleanisUnknown()ByteOrdernativeByteOrder()intpointerSizeBits()intpointerSizeBytes()static CPUvalueOf(String name)Returns the enum constant of this type with the specified name.static CPU[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
unknown32
public static final CPU unknown32
An unknown 32-bit little-endian CPU.
-
unknown32be
public static final CPU unknown32be
An unknown 32-bit big-endian CPU.
-
unknown64
public static final CPU unknown64
An unknown 64-bit little-endian CPU.
-
unknown64be
public static final CPU unknown64be
An unknown 64-bit big-endian CPU.
-
x64
public static final CPU x64
-
x86
public static final CPU x86
-
aarch64
public static final CPU aarch64
-
arm
public static final CPU arm
-
riscv
public static final CPU riscv
-
ppc32
public static final CPU ppc32
-
ppc32le
public static final CPU ppc32le
-
ppc
public static final CPU ppc
-
ppcle
public static final CPU ppcle
-
wasm32
public static final CPU wasm32
-
mips
public static final CPU mips
-
mipsel
public static final CPU mipsel
-
mips64
public static final CPU mips64
-
mips64el
public static final CPU mips64el
-
-
Method Detail
-
values
public static CPU[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (CPU c : CPU.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static CPU 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 nameNullPointerException- if the argument is null
-
pointerSizeBytes
public int pointerSizeBytes()
- Returns:
- this CPU's pointer size, in bytes
-
pointerSizeBits
public int pointerSizeBits()
- Returns:
- this CPU's pointer size, in bits
-
nativeByteOrder
public ByteOrder nativeByteOrder()
- Returns:
- this CPU's native byte order
-
isUnknown
public boolean isUnknown()
- Returns:
trueif this CPU is unknown
-
forName
public static CPU forName(String name) throws NoSuchElementException
Names are compared case-insensitively.- Parameters:
name- aStringfor the CPU name- Returns:
- the CPU for the given name
- Throws:
NoSuchElementException- if no such CPU is found
-
forNameOrNull
public static CPU forNameOrNull(String name) throws NoSuchElementException
Names are compared case-insensitively.- Parameters:
name- aStringfor the CPU name- Returns:
- the CPU for the given name or
nullif it is not found - Throws:
NoSuchElementException
-
forNameOpt
public static Optional<CPU> forNameOpt(String name) throws NoSuchElementException
Names are compared case-insensitively.- Parameters:
name- aStringfor the CPU name- Returns:
- the optional CPU for the given name
- Throws:
NoSuchElementException
-
host
public static CPU host()
- Returns:
- the host CPU type
-
-