Package discord4j.core.object
Class PermissionOverwrite
- java.lang.Object
-
- discord4j.core.object.PermissionOverwrite
-
- Direct Known Subclasses:
ExtendedPermissionOverwrite
public class PermissionOverwrite extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPermissionOverwrite.TypeThe type of entity aPermissionOverwriteis for.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PermissionOverwriteforMember(Snowflake memberId, PermissionSet allowed, PermissionSet denied)Constructs aPermissionOverwritetargeting aMember.static PermissionOverwriteforRole(Snowflake roleId, PermissionSet allowed, PermissionSet denied)Constructs aPermissionOverwritetargeting aRole.PermissionSetgetAllowed()Gets the permissions explicitly allowed by this overwrite.discord4j.discordjson.json.OverwriteDatagetData()Map thisPermissionOverwriteobject to aOverwriteDataJSON.PermissionSetgetDenied()Gets the permissions explicitly denied by this overwrite.Optional<Snowflake>getMemberId()Gets the ID of the member this overwrite targets.Optional<Snowflake>getRoleId()Gets the ID of the role this overwrite targets.SnowflakegetTargetId()Gets the ID of the entity this overwrite targets.PermissionOverwrite.TypegetType()Gets the type of the overwrite.StringtoString()
-
-
-
Method Detail
-
forMember
public static PermissionOverwrite forMember(Snowflake memberId, PermissionSet allowed, PermissionSet denied)
Constructs aPermissionOverwritetargeting aMember.- 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
PermissionOverwritetargeting the given member.
-
forRole
public static PermissionOverwrite forRole(Snowflake roleId, PermissionSet allowed, PermissionSet denied)
Constructs aPermissionOverwritetargeting aRole.- 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
PermissionOverwritetargeting the given role.
-
getData
public discord4j.discordjson.json.OverwriteData getData()
Map thisPermissionOverwriteobject to aOverwriteDataJSON.- 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.
-
-