Enum 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 place
      DEFAULT
      Discord has not rated this guild.
      EXPLICIT
      Is classified as a NSFW server
      SAFE
      Doesn't classify as a NSFW server
      UNKNOWN
      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 a NSFWLevel 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.
      • Methods inherited from class java.lang.Enum

        compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • 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 name
        java.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 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.