public class PermissionOverwrite extends Object
Modifier and Type | Class and Description |
---|---|
static class |
PermissionOverwrite.Type
The type of entity a
PermissionOverwrite is for. |
Modifier and Type | Method and Description |
---|---|
static PermissionOverwrite |
forMember(Snowflake memberId,
PermissionSet allowed,
PermissionSet denied)
Constructs a
PermissionOverwrite targeting a Member . |
static PermissionOverwrite |
forRole(Snowflake roleId,
PermissionSet allowed,
PermissionSet denied)
Constructs a
PermissionOverwrite targeting a Role . |
PermissionSet |
getAllowed()
Gets the permissions explicitly allowed by this overwrite.
|
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() |
public static PermissionOverwrite forMember(Snowflake memberId, PermissionSet allowed, PermissionSet denied)
PermissionOverwrite
targeting a Member
.memberId
- The ID of the member to target.allowed
- The permissions explicitly allowed by the overwrite.denied
- The permissions explicitly denied by the overwrite.PermissionOverwrite
targeting the given member.public static PermissionOverwrite forRole(Snowflake roleId, PermissionSet allowed, PermissionSet denied)
PermissionOverwrite
targeting a Role
.roleId
- The ID of the role to target.allowed
- The permissions explicitly allowed by the overwrite.denied
- The permissions explicitly denied by the overwrite.PermissionOverwrite
targeting the given role.public PermissionSet getAllowed()
public PermissionSet getDenied()
public Snowflake getTargetId()
getRoleId()
,
getMemberId()
public Optional<Snowflake> getRoleId()
public Optional<Snowflake> getMemberId()
public PermissionOverwrite.Type getType()