Enum Guild.NSFWLevel

java.lang.Object
java.lang.Enum<Guild.NSFWLevel>
net.dv8tion.jda.api.entities.Guild.NSFWLevel
All Implemented Interfaces:
Serializable, Comparable<Guild.NSFWLevel>
Enclosing interface:
Guild

public static enum Guild.NSFWLevel extends Enum<Guild.NSFWLevel>
Represents the NSFW level for this guild.
  • Enum Constant Details

    • 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 Details

    • values

      public static Guild.NSFWLevel[] 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

      public static Guild.NSFWLevel valueOf(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:
      IllegalArgumentException - if this enum type has no constant with the specified name
      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 a NSFWLevel 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.