Enum Class PunishmentType
- All Implemented Interfaces:
Serializable,Comparable<PunishmentType>,Constable
Represents the type of punishment.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanexists(PunishmentType type) Checks if a specifiedPunishmentTypeexists in the database.static PunishmentTypefromString(String value) Converts a string representation of a punishment type to its corresponding enum constant.intgetId()getName()booleanisTypeIp()static voidstatic PunishmentTypeReturns the enum constant of this class with the specified name.static PunishmentType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
BAN
-
MUTE
-
IP_BAN
-
IP_MUTE
-
-
Field Details
-
VALUES
-
-
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
-
getId
public int getId() -
getName
-
isTypeIp
public boolean isTypeIp() -
fromString
Converts a string representation of a punishment type to its corresponding enum constant.- Parameters:
value- The string representation of the punishment type- Returns:
- The corresponding
PunishmentTypeif a match is found, ornullif no match exists
-
exists
Checks if a specifiedPunishmentTypeexists in the database.- Parameters:
type- The punishment type to check for existence in the database.- Returns:
trueif the specified punishment type exists in the database,falseotherwise.
-
setup
-