- All Superinterfaces:
MachineCompatibilityAspect
- All Known Implementing Classes:
CPUArchitectures
A type that models a coarse-grained CPU architecture.
If you wish, you can extend this to model additional attributes of a CPU ISA such as instruction set extensions.
-
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic CPUArchitectureReturns a C library from thealias mapor throwsUnrecognizedAliasException.static CPUArchitecturefromOrNull(String name) Lower-cases the name parameter and then looks it up in thealias map.static CPUArchitecturefromOrUnknown(String name) Same asfrom(java.lang.String)but returnsOperatingSystems.UNKNOWNinstead of throwing an exception if the name isn't recognized.Methods inherited from interface dev.hydraulic.types.machines.MachineCompatibilityAspect
getAliases, getDisplayName, getIdentifier, getVendor
-
Method Details
-
fromOrNull
Lower-cases the name parameter and then looks it up in thealias map.- Parameters:
name- The primary name or alias of an operating system. Case-insensitive.- Returns:
- a member of the enum or null if not recognized.
- Throws:
IllegalArgumentException- if name is blank.
-
fromOrUnknown
Same asfrom(java.lang.String)but returnsOperatingSystems.UNKNOWNinstead of throwing an exception if the name isn't recognized.- Parameters:
name- primary name or alias of the well known operating system.
-
from
Returns a C library from thealias mapor throwsUnrecognizedAliasException.- Parameters:
name- primary name or alias of the well known operating system. Case-insensitive.- Returns:
- the C library enum value.
- Throws:
IllegalArgumentException- if name is blank.UnrecognizedAliasException- if name isn't a known operating system name or alias (compared case insensitively).
-