Enum CacheFlag

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<CacheFlag>

    public enum CacheFlag
    extends java.lang.Enum<CacheFlag>
    Flags used to enable cache services for JDA.
    Check the flag descriptions to see which intents are required to use them.
    • Method Detail

      • values

        public static CacheFlag[] 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 (CacheFlag c : CacheFlag.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static CacheFlag 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
      • getRequiredIntent

        @Nullable
        public GatewayIntent getRequiredIntent()
        The required GatewayIntent for this cache flag.
        Returns:
        The required intent, or null if no intents are required.
      • isPresence

        public boolean isPresence()
        Whether this cache flag is for presence information of a member.
        Returns:
        True, if this is for presences
      • getPrivileged

        @Nonnull
        public static java.util.EnumSet<CacheFlag> getPrivileged()
        Collects all cache flags that require privileged intents
        Returns:
        EnumSet of the cache flags that require the privileged intents