Enum Class CreateParams.Flags

java.lang.Object
java.lang.Enum<CreateParams.Flags>
de.jcm.discordgamesdk.CreateParams.Flags
All Implemented Interfaces:
Serializable, Comparable<CreateParams.Flags>, Constable
Enclosing class:
CreateParams

public static enum CreateParams.Flags extends Enum<CreateParams.Flags>
Enum representing possible Flags in CreateParams.
  • Enum Constant Details

    • DEFAULT

      public static final CreateParams.Flags 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

      public static final CreateParams.Flags 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 throw GameSDKExceptions.

      Use SUPPRESS_EXCEPTIONS to suppress exceptions in those operations as well.

      Use Core.isDiscordRunning() to check if Discord is available.

    • SUPPRESS_EXCEPTIONS

      public static final CreateParams.Flags SUPPRESS_EXCEPTIONS
      Suppresses all exceptions. This implies NO_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

      public static CreateParams.Flags[] 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

      public static CreateParams.Flags valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • toLong

      public static long toLong(CreateParams.Flags... flags)
      Converts an array of flags to their binary representation.
      Parameters:
      flags - Flags to convert.
      Returns:
      A binary representation of the given Flags.
    • fromLong

      public static CreateParams.Flags[] fromLong(long l)
      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 to myLong.

      Parameters:
      l - Binary representation
      Returns:
      Array of Flags that are set for the given long