Enum Class DatabaseFlag
- All Implemented Interfaces:
Serializable, Comparable<DatabaseFlag>, Constable
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescription -
Method Summary
Modifier and TypeMethodDescriptionstatic EnumSet<DatabaseFlag> fromValue(int value) Converts an integer value into a set of DatabaseFlags that are enabled in that value.Gets the name associated with this flag, which corresponds to a configuration key.Gets the internal name associated with this flag, which corresponds to the database name.intgetMask()Gets the bitmask value associated with this flag.booleanisSet(int value) Checks if the given value has this flag set.static DatabaseFlagReturns the enum constant of this class with the specified name.static DatabaseFlag[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
DATABASE_LOGIN
-
DATABASE_CHARACTER
-
DATABASE_WORLD
-
DATABASE_HOTFIX
-
DATABASE_SHOP
-
-
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
-
getMask
public int getMask()Gets the bitmask value associated with this flag.- Returns:
- The integer bitmask for this flag.
-
getConfigKeyName
Gets the name associated with this flag, which corresponds to a configuration key.- Returns:
- The name of the flag.
-
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
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.
-