- All Superinterfaces:
MachineCompatibilityAspect
- All Known Implementing Classes:
OperatingSystems
A type that represents an operating system or family of closely related operating systems.
This interface is implemented by the members of OperatingSystems. When writing code that wants to represent an operating system
use this marker type instead of the values of OperatingSystems directly so others can create objects representing otherwise
unknown operating systems and pass them into your code.
This interface doesn't add any additional properties over the MachineCompatibilityAspect interface.
Compatibility note: don't implement this interface unless you're willing to tolerate source breakage. Additional properties useful for identifying operating systems may be added here over time.
-
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic OperatingSystemLooks up an operating system in theOperatingSystems.ALIAS_MAPor throwsUnrecognizedAliasException.static OperatingSystemfromOrNull(String name) Lower-cases the name parameter and then looks it up in theOperatingSystems.ALIAS_MAP.static OperatingSystemfromOrUnknown(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 theOperatingSystems.ALIAS_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
Looks up an operating system in theOperatingSystems.ALIAS_MAPor throwsUnrecognizedAliasException.- Parameters:
name- primary name or alias of the well known operating system. Case-insensitive.- Returns:
- the operating system entry.
- Throws:
IllegalArgumentException- if name is blank.UnrecognizedAliasException- if name isn't a known operating system name or alias (compared case insensitively).
-