Package discord4j.core.object
Class ExtendedPermissionOverwrite
- java.lang.Object
-
- discord4j.core.object.PermissionOverwrite
-
- discord4j.core.object.ExtendedPermissionOverwrite
-
- All Implemented Interfaces:
DiscordObject
public final class ExtendedPermissionOverwrite extends PermissionOverwrite implements DiscordObject
A Discord permission overwrite.- See Also:
- Overwrite Object
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class discord4j.core.object.PermissionOverwrite
PermissionOverwrite.Type
-
-
Constructor Summary
Constructors Constructor Description ExtendedPermissionOverwrite(GatewayDiscordClient gateway, discord4j.discordjson.json.OverwriteData data, long guildId, long channelId)Constructs aExtendedPermissionOverwritewith an associatedGatewayDiscordClientand Discord data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Mono<Void>delete()Requests to delete this permission overwrite.Mono<Void>delete(String reason)Requests to delete this permission overwrite while optionally specifying a reason.Mono<GuildChannel>getChannel()Requests to retrieve the channel associated to this overwrite.Mono<GuildChannel>getChannel(EntityRetrievalStrategy retrievalStrategy)Requests to retrieve the channel associated to this overwrite, using the given retrieval strategy.SnowflakegetChannelId()Gets the ID of the channel associated to this overwrite.GatewayDiscordClientgetClient()Returns theGatewayDiscordClientthat created this object.Mono<Guild>getGuild()Requests to retrieve the guild associated to this overwrite.Mono<Guild>getGuild(EntityRetrievalStrategy retrievalStrategy)Requests to retrieve the guild associated to this overwrite, using the given retrieval strategy.SnowflakegetGuildId()Gets the ID of the guild associated to this overwrite.Mono<Role>getRole()Requests to retrieve the role this overwrite is associated to, if present.Mono<Role>getRole(EntityRetrievalStrategy retrievalStrategy)Requests to retrieve the role this overwrite is associated to, if present, using the given retrieval strategy.Mono<User>getUser()Requests to retrieve the user this overwrite is associated to, if present.Mono<User>getUser(EntityRetrievalStrategy retrievalStrategy)Requests to retrieve the user this overwrite is associated to, if present, using the given retrieval strategy.-
Methods inherited from class discord4j.core.object.PermissionOverwrite
forMember, forRole, getAllowed, getData, getDenied, getMemberId, getRoleId, getTargetId, getType, toString
-
-
-
-
Constructor Detail
-
ExtendedPermissionOverwrite
public ExtendedPermissionOverwrite(GatewayDiscordClient gateway, discord4j.discordjson.json.OverwriteData data, long guildId, long channelId)
Constructs aExtendedPermissionOverwritewith an associatedGatewayDiscordClientand Discord data.- Parameters:
gateway- TheGatewayDiscordClientassociated to this object, must be non-null.data- The raw data as represented by Discord, must be non-null.guildId- The ID of the guild associated to this overwrite.channelId- The ID of the channel associated to this overwrite.
-
-
Method Detail
-
getClient
public GatewayDiscordClient getClient()
Description copied from interface:DiscordObjectReturns theGatewayDiscordClientthat created this object. Methods in it are exclusively based on the entity cache orStorein use. Refer to callinggetClient().rest()to access aDiscordClientthat is capable of requesting entities directly from the REST API.- Specified by:
getClientin interfaceDiscordObject- Returns:
- The
GatewayDiscordClientassociated to this object.
-
getRole
public Mono<Role> getRole()
Requests to retrieve the role this overwrite is associated to, if present.
-
getRole
public Mono<Role> getRole(EntityRetrievalStrategy retrievalStrategy)
Requests to retrieve the role this overwrite is associated to, if present, using the given retrieval strategy.
-
getUser
public Mono<User> getUser()
Requests to retrieve the user this overwrite is associated to, if present.
-
getUser
public Mono<User> getUser(EntityRetrievalStrategy retrievalStrategy)
Requests to retrieve the user this overwrite is associated to, if present, using the given retrieval strategy.
-
getGuildId
public Snowflake getGuildId()
Gets the ID of the guild associated to this overwrite.- Returns:
- The ID of the guild associated to this overwrite.
-
getGuild
public Mono<Guild> getGuild(EntityRetrievalStrategy retrievalStrategy)
Requests to retrieve the guild associated to this overwrite, using the given retrieval strategy.
-
getChannelId
public Snowflake getChannelId()
Gets the ID of the channel associated to this overwrite.- Returns:
- The ID of the channel associated to this overwrite.
-
getChannel
public Mono<GuildChannel> getChannel()
Requests to retrieve the channel associated to this overwrite.- Returns:
- A
Monowhere, upon successful completion, emits theGuildChannelassociated to this overwrite. If an error is received, it is emitted through theMono.
-
getChannel
public Mono<GuildChannel> getChannel(EntityRetrievalStrategy retrievalStrategy)
Requests to retrieve the channel associated to this overwrite, using the given retrieval strategy.- Parameters:
retrievalStrategy- the strategy to use to get the channel- Returns:
- A
Monowhere, upon successful completion, emits theGuildChannelassociated to this overwrite. If an error is received, it is emitted through theMono.
-
delete
public Mono<Void> delete()
Requests to delete this permission overwrite.- Returns:
- A
Monowhere, upon successful completion, emits nothing; indicating the permission overwrite has been deleted. If an error is received, it is emitted through theMono.
-
delete
public Mono<Void> delete(@Nullable String reason)
Requests to delete this permission overwrite while optionally specifying a reason.- Parameters:
reason- The reason, if present.- Returns:
- A
Monowhere, upon successful completion, emits nothing; indicating the permission overwrite has been deleted. If an error is received, it is emitted through theMono.
-
-