Class PermissionOverwrite

    • Method Detail

      • forMember

        public static PermissionOverwrite forMember​(Snowflake memberId,
                                                    PermissionSet allowed,
                                                    PermissionSet denied)
        Constructs a PermissionOverwrite targeting a Member.
        Parameters:
        memberId - The ID of the member to target.
        allowed - The permissions explicitly allowed by the overwrite.
        denied - The permissions explicitly denied by the overwrite.
        Returns:
        A PermissionOverwrite targeting the given member.
      • forRole

        public static PermissionOverwrite forRole​(Snowflake roleId,
                                                  PermissionSet allowed,
                                                  PermissionSet denied)
        Constructs a PermissionOverwrite targeting a Role.
        Parameters:
        roleId - The ID of the role to target.
        allowed - The permissions explicitly allowed by the overwrite.
        denied - The permissions explicitly denied by the overwrite.
        Returns:
        A PermissionOverwrite targeting the given role.
      • getData

        public discord4j.discordjson.json.OverwriteData getData()
        Map this PermissionOverwrite object to a OverwriteData JSON.
        Returns:
        JSON object.
      • getAllowed

        public PermissionSet getAllowed()
        Gets the permissions explicitly allowed by this overwrite.
        Returns:
        The permissions explicitly allowed by this overwrite.
      • getDenied

        public PermissionSet getDenied()
        Gets the permissions explicitly denied by this overwrite.
        Returns:
        The permissions explicitly denied by this overwrite.
      • getTargetId

        public Snowflake getTargetId()
        Gets the ID of the entity this overwrite targets. This is either a role ID or a member ID.
        Returns:
        The ID of the entity this overwrite targets.
        See Also:
        getRoleId(), getMemberId()
      • getRoleId

        public Optional<Snowflake> getRoleId()
        Gets the ID of the role this overwrite targets.
        Returns:
        The ID of the role this overwrite targets.
      • getMemberId

        public Optional<Snowflake> getMemberId()
        Gets the ID of the member this overwrite targets.
        Returns:
        The ID of the member this overwrite targets.
      • getType

        public PermissionOverwrite.Type getType()
        Gets the type of the overwrite.
        Returns:
        The type of the overwrite.