Package de.jcm.discordgamesdk
Enum Class CreateParams.Flags
- All Implemented Interfaces:
Serializable
,Comparable<CreateParams.Flags>
,Constable
- Enclosing class:
CreateParams
Enum representing possible Flags in
CreateParams
.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionThis flag requires Discord to be active in order to use the SDK.This flag does not require Discord to be active to use the SDK.Suppresses all exceptions. -
Method Summary
Modifier and TypeMethodDescriptionstatic CreateParams.Flags[]
fromLong
(long l) Converts the binary representation of flags to an array of Flags.static long
toLong
(CreateParams.Flags... flags) Converts an array of flags to their binary representation.static CreateParams.Flags
Returns the enum constant of this class with the specified name.static CreateParams.Flags[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
DEFAULT
This flag requires Discord to be active in order to use the SDK. If Discord isn't active, the application will terminate and tires to start itself via Discord.This might cause issues on many platforms (e.g. on some Linux distributions).
-
NO_REQUIRE_DISCORD
This flag does not require Discord to be active to use the SDK.Nevertheless,
Core.runCallbacks()
and all other relevant operations will fail if Discord is not active and throwGameSDKException
s.Use
SUPPRESS_EXCEPTIONS
to suppress exceptions in those operations as well.Use
Core.isDiscordRunning()
to check if Discord is available. -
SUPPRESS_EXCEPTIONS
Suppresses all exceptions. This impliesNO_REQUIRE_DISCORD
. All operations will be effectively a no-op if Discord is not running. The library does not automatically reconnect to Discord if it launches.Use
Core.isDiscordRunning()
to check if Discord is available.
-
-
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
-
toLong
Converts an array of flags to their binary representation.- Parameters:
flags
- Flags to convert.- Returns:
- A binary representation of the given Flags.
-
fromLong
Converts the binary representation of flags to an array of Flags.However, unknown flags that are present in the binary presentation will not be included in the array. Hence,
Flags.toLong(Flags.fromLong(myLong))
is not guaranteed to be equal tomyLong
.- Parameters:
l
- Binary representation- Returns:
- Array of Flags that are set for the given long
-