Enum Class DatabaseFlag

java.lang.Object
java.lang.Enum<DatabaseFlag>
br.net.dd.netherwingcore.database.updater.DatabaseFlag
All Implemented Interfaces:
Serializable, Comparable<DatabaseFlag>, Constable

public enum DatabaseFlag extends Enum<DatabaseFlag>
This enum represents the different databases that can be updated by the DBUpdater. Each flag corresponds to a specific database and is represented as a bitmask. The flags can be combined using bitwise operations to enable multiple databases at once.
  • Enum Constant Details

    • DATABASE_LOGIN

      public static final DatabaseFlag DATABASE_LOGIN
    • DATABASE_CHARACTER

      public static final DatabaseFlag DATABASE_CHARACTER
    • DATABASE_WORLD

      public static final DatabaseFlag DATABASE_WORLD
    • DATABASE_HOTFIX

      public static final DatabaseFlag DATABASE_HOTFIX
    • DATABASE_SHOP

      public static final DatabaseFlag DATABASE_SHOP
  • Method Details

    • values

      public static DatabaseFlag[] 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 DatabaseFlag 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
    • getMask

      public int getMask()
      Gets the bitmask value associated with this flag.
      Returns:
      The integer bitmask for this flag.
    • getConfigKeyName

      public String getConfigKeyName()
      Gets the name associated with this flag, which corresponds to a configuration key.
      Returns:
      The name of the flag.
    • getInternalName

      public String getInternalName()
      Gets the internal name associated with this flag, which corresponds to the database name.
      Returns:
      The internal name of the flag.
    • isSet

      public boolean isSet(int value)
      Checks if the given value has this flag set.
      Parameters:
      value - The integer value to check against the flag.
      Returns:
      true if the flag is set in the value, false otherwise.
    • fromValue

      public static EnumSet<DatabaseFlag> fromValue(int value)
      Converts an integer value into a set of DatabaseFlags that are enabled in that value.
      Parameters:
      value - The integer value representing the combined flags.
      Returns:
      An EnumSet of DatabaseFlags that are set in the given value.