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 class
PermissionOverwrite.Type
The type of entity aPermissionOverwrite
is for.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static 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
.PermissionSet
getAllowed()
Gets the permissions explicitly allowed by this overwrite.discord4j.discordjson.json.OverwriteData
getData()
Map thisPermissionOverwrite
object to aOverwriteData
JSON.PermissionSet
getDenied()
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.Snowflake
getTargetId()
Gets the ID of the entity this overwrite targets.PermissionOverwrite.Type
getType()
Gets the type of the overwrite.String
toString()
-
-
-
Method Detail
-
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
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.
-
-