Package io.github.jwharm.javagi.interop
Enum Class Platform
- All Implemented Interfaces:
Serializable
,Comparable<Platform>
,Constable
The Platform class provides utility functions to retrieve the runtime
platform and and check if a function is supported on the runtime platform.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic void
checkSupportedPlatform
(Platform... supportedPlatforms) Check if the runtime platform is in the list of provided platforms; if not, throws UnsupportedPlatformException.static Platform
Determine the runtime platformstatic Platform
Returns the enum constant of this class with the specified name.static Platform[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
WINDOWS
-
LINUX
-
MACOS
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException
- if the argument is null
-
getRuntimePlatform
Determine the runtime platform- Returns:
- the runtime platform: "windows", "linux" or "macos"
-
checkSupportedPlatform
public static void checkSupportedPlatform(Platform... supportedPlatforms) throws UnsupportedPlatformException Check if the runtime platform is in the list of provided platforms; if not, throws UnsupportedPlatformException.- Parameters:
supportedPlatforms
- the platforms on which the api call is supported- Throws:
UnsupportedPlatformException
- when the runtime platform does not support this api call
-