Package net.dv8tion.jda.api.entities
Enum Guild.NSFWLevel
- All Implemented Interfaces:
Serializable
,Comparable<Guild.NSFWLevel>
- Enclosing interface:
- Guild
Represents the NSFW level for this guild.
-
Enum Constant Summary
Enum ConstantDescriptionIs classified as NSFW and has an age restriction in placeDiscord has not rated this guild.Is classified as a NSFW serverDoesn't classify as a NSFW serverPlaceholder for unsupported levels. -
Method Summary
Modifier and TypeMethodDescriptionstatic Guild.NSFWLevel
fromKey
(int key) Used to retrieve aNSFWLevel
based on the Discord id key.int
getKey()
The Discord id key used to represent this NSFW level.static Guild.NSFWLevel
Returns the enum constant of this type with the specified name.static Guild.NSFWLevel[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
DEFAULT
Discord has not rated this guild. -
EXPLICIT
Is classified as a NSFW server -
SAFE
Doesn't classify as a NSFW server -
AGE_RESTRICTED
Is classified as NSFW and has an age restriction in place -
UNKNOWN
Placeholder for unsupported levels.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException
- if the argument is null
-
getKey
public int getKey()The Discord id key used to represent this NSFW level.- Returns:
- Integer id for this NSFW level.
-
fromKey
Used to retrieve aNSFWLevel
based on the Discord id key.- Parameters:
key
- The Discord id key representing the requested NSFWLevel.- Returns:
- The NSFWLevel related to the provided key, or
NSFWLevel.UNKNOWN
if the key is not recognized.
-