Interface PermissionOverride

    • Method Detail

      • getAllowedRaw

        long getAllowedRaw()
        This is the raw binary representation (as a base 10 long) of the permissions allowed by this override.
        The long relates to the offsets used by each Permission.
        Returns:
        Never-negative long containing the binary representation of the allowed permissions of this override.
      • getInheritRaw

        long getInheritRaw()
        This is the raw binary representation (as a base 10 long) of the permissions not affected by this override.
        The long relates to the offsets used by each Permission.
        Returns:
        Never-negative long containing the binary representation of the unaffected permissions of this override.
      • getDeniedRaw

        long getDeniedRaw()
        This is the raw binary representation (as a base 10 long) of the permissions denied by this override.
        The long relates to the offsets used by each Permission.
        Returns:
        Never-negative long containing the binary representation of the denied permissions of this override.
      • getAllowed

        @Nonnull
        java.util.EnumSet<Permission> getAllowed()
        EnumSet of all Permissions that are specifically allowed by this override.
        Changes to the returned set do not affect this entity directly.
        Returns:
        Possibly-empty set of allowed Permissions.
      • getInherit

        @Nonnull
        java.util.EnumSet<Permission> getInherit()
        EnumSet of all Permission that are unaffected by this override.
        Changes to the returned set do not affect this entity directly.
        Returns:
        Possibly-empty set of unaffected Permissions.
      • getDenied

        @Nonnull
        java.util.EnumSet<Permission> getDenied()
        EnumSet of all Permissions that are denied by this override.
        Changes to the returned set do not affect this entity directly.
        Returns:
        Possibly-empty set of denied Permissions.
      • getJDA

        @Nonnull
        JDA getJDA()
        The JDA instance that this PermissionOverride is related to.
        Returns:
        Never-null JDA instance.
      • getMember

        @Nullable
        Member getMember()
        If this PermissionOverride is an override dealing with a Member, then this method will return the related Member if the member is currently cached.
        Otherwise, this method returns null.
        Basically: if isMemberOverride() returns false or the member is not cached, this returns null.
        Returns:
        Possibly-null related Member.
      • getRole

        @Nullable
        Role getRole()
        If this PermissionOverride is an override dealing with a Role, then this method will return the related Role.
        Otherwise, this method returns null.
        Basically: if isRoleOverride() returns false, this returns null.
        Returns:
        Possibly-null related Role.
      • isMemberOverride

        boolean isMemberOverride()
        Used to determine if this PermissionOverride relates to a specific Member.
        Returns:
        True if this override is a user override.
      • isRoleOverride

        boolean isRoleOverride()
        Used to determine if this PermissionOverride relates to a specific Role.
        Returns:
        True if this override is a role override.
      • getManager

        @Nonnull
        PermissionOverrideAction getManager()
        Returns the PermissionOverrideAction to modify this PermissionOverride.
        In the PermissionOverrideAction you can modify the permissions of the override. You modify multiple fields in one request by chaining setters before calling RestAction.queue().

        This is a lazy idempotent getter. The manager is retained after the first call. This getter is not thread-safe and would require guards by the user.

        Returns:
        The PermissionOverrideAction of this override.
        Throws:
        InsufficientPermissionException - If the currently logged in account does not have Permission.MANAGE_PERMISSIONS