Package org.apache.commons.lang3
Class ArchUtils
- java.lang.Object
-
- org.apache.commons.lang3.ArchUtils
-
public class ArchUtils extends java.lang.Object
Provides methods for identifying the architecture of the current JVM based on the"os.arch"
system property.Important: The
"os.arch"
system property returns the architecture used by the JVM not of the operating system.- Since:
- 3.6
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.Map<java.lang.String,Processor>
ARCH_TO_PROCESSOR
-
Constructor Summary
Constructors Constructor Description ArchUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static void
addProcessor(java.lang.String key, Processor processor)
Adds the givenProcessor
with the given keyString
to the map.private static void
addProcessors(Processor processor, java.lang.String... keys)
Adds the givenProcessor
with the given keys to the map.static Processor
getProcessor()
Gets aProcessor
object of the current JVM.static Processor
getProcessor(java.lang.String value)
Gets aProcessor
object the given valueString
.private static void
init()
private static void
init_Aarch_64Bit()
private static void
init_IA64_32Bit()
private static void
init_IA64_64Bit()
private static void
init_PPC_32Bit()
private static void
init_PPC_64Bit()
private static void
init_RISCV_32Bit()
private static void
init_RISCV_64Bit()
private static void
init_X86_32Bit()
private static void
init_X86_64Bit()
-
-
-
Field Detail
-
ARCH_TO_PROCESSOR
private static final java.util.Map<java.lang.String,Processor> ARCH_TO_PROCESSOR
-
-
Method Detail
-
addProcessor
private static void addProcessor(java.lang.String key, Processor processor)
Adds the givenProcessor
with the given keyString
to the map.- Parameters:
key
- The key asString
.processor
- TheProcessor
to add.- Throws:
java.lang.IllegalStateException
- If the key already exists.
-
addProcessors
private static void addProcessors(Processor processor, java.lang.String... keys)
Adds the givenProcessor
with the given keys to the map.- Parameters:
keys
- The keys.processor
- TheProcessor
to add.- Throws:
java.lang.IllegalStateException
- If the key already exists.
-
getProcessor
public static Processor getProcessor()
Gets aProcessor
object of the current JVM.Important: The
"os.arch"
system property returns the architecture used by the JVM not of the operating system.- Returns:
- A
Processor
when supported, elsenull
.
-
getProcessor
public static Processor getProcessor(java.lang.String value)
Gets aProcessor
object the given valueString
. TheString
must be like a value returned by the"os.arch"
system property.- Parameters:
value
- AString
like a value returned by theos.arch
System Property.- Returns:
- A
Processor
when it exists, elsenull
.
-
init
private static void init()
-
init_Aarch_64Bit
private static void init_Aarch_64Bit()
-
init_IA64_32Bit
private static void init_IA64_32Bit()
-
init_IA64_64Bit
private static void init_IA64_64Bit()
-
init_PPC_32Bit
private static void init_PPC_32Bit()
-
init_PPC_64Bit
private static void init_PPC_64Bit()
-
init_RISCV_32Bit
private static void init_RISCV_32Bit()
-
init_RISCV_64Bit
private static void init_RISCV_64Bit()
-
init_X86_32Bit
private static void init_X86_32Bit()
-
init_X86_64Bit
private static void init_X86_64Bit()
-
-