Package discord4j.core.object
Class PermissionOverwrite
java.lang.Object
discord4j.core.object.PermissionOverwrite
- Direct Known Subclasses:
ExtendedPermissionOverwrite
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic PermissionOverwrite
forMember
(Snowflake memberId, PermissionSet allowed, PermissionSet denied) Constructs aPermissionOverwrite
targeting aMember
.static PermissionOverwrite
forRole
(Snowflake roleId, PermissionSet allowed, PermissionSet denied) Constructs aPermissionOverwrite
targeting aRole
.Gets the permissions explicitly allowed by this overwrite.discord4j.discordjson.json.OverwriteData
getData()
Map thisPermissionOverwrite
object to aOverwriteData
JSON.Gets the permissions explicitly denied by this overwrite.Gets the ID of the member this overwrite targets.Gets the ID of the role this overwrite targets.Gets the ID of the entity this overwrite targets.getType()
Gets the type of the overwrite.toString()
-
Method Details
-
forMember
public static PermissionOverwrite forMember(Snowflake memberId, PermissionSet allowed, PermissionSet denied) Constructs aPermissionOverwrite
targeting 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
PermissionOverwrite
targeting the given member.
-
forRole
public static PermissionOverwrite forRole(Snowflake roleId, PermissionSet allowed, PermissionSet denied) Constructs aPermissionOverwrite
targeting 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
PermissionOverwrite
targeting the given role.
-
getData
public discord4j.discordjson.json.OverwriteData getData()Map thisPermissionOverwrite
object to aOverwriteData
JSON.- Returns:
- JSON object.
-
getAllowed
Gets the permissions explicitly allowed by this overwrite.- Returns:
- The permissions explicitly allowed by this overwrite.
-
getDenied
Gets the permissions explicitly denied by this overwrite.- Returns:
- The permissions explicitly denied by this overwrite.
-
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
Gets the ID of the role this overwrite targets.- Returns:
- The ID of the role this overwrite targets.
-
getMemberId
Gets the ID of the member this overwrite targets.- Returns:
- The ID of the member this overwrite targets.
-
getType
Gets the type of the overwrite.- Returns:
- The type of the overwrite.
-
toString
-