Package net.dv8tion.jda.api.entities
Enum Guild.NSFWLevel
- java.lang.Object
-
- java.lang.Enum<Guild.NSFWLevel>
-
- net.dv8tion.jda.api.entities.Guild.NSFWLevel
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<Guild.NSFWLevel>
- Enclosing interface:
- Guild
public static enum Guild.NSFWLevel extends java.lang.Enum<Guild.NSFWLevel>
Represents the NSFW level for this guild.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description AGE_RESTRICTED
Is classified as NSFW and has an age restriction in placeDEFAULT
Discord has not rated this guild.EXPLICIT
Is classified as a NSFW serverSAFE
Doesn't classify as a NSFW serverUNKNOWN
Placeholder for unsupported levels.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static 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
valueOf(java.lang.String name)
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 Detail
-
DEFAULT
public static final Guild.NSFWLevel DEFAULT
Discord has not rated this guild.
-
EXPLICIT
public static final Guild.NSFWLevel EXPLICIT
Is classified as a NSFW server
-
SAFE
public static final Guild.NSFWLevel SAFE
Doesn't classify as a NSFW server
-
AGE_RESTRICTED
public static final Guild.NSFWLevel AGE_RESTRICTED
Is classified as NSFW and has an age restriction in place
-
UNKNOWN
public static final Guild.NSFWLevel UNKNOWN
Placeholder for unsupported levels.
-
-
Method Detail
-
values
public static Guild.NSFWLevel[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Guild.NSFWLevel c : Guild.NSFWLevel.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Guild.NSFWLevel valueOf(java.lang.String name)
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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- 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
@Nonnull public static Guild.NSFWLevel fromKey(int key)
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.
-
-