public class KickCommand extends ChannelCommand
Constructor and Description |
---|
KickCommand(Client client,
String channel)
Constructs a KICK command for a given channel.
|
Modifier and Type | Method and Description |
---|---|
void |
execute()
Executes the command.
|
KickCommand |
reason(String reason)
Sets the reason for this kick.
|
KickCommand |
target(String target)
Sets the target of this kick.
|
KickCommand |
target(User target)
Sets the target of this kick.
|
protected ToStringer |
toStringer()
Generates a partial
ToStringer for the command. |
getChannel
public KickCommand(@Nonnull Client client, @Nonnull String channel)
client
- the client on which this command is executingchannel
- channel targetedIllegalArgumentException
- if null parametersChannel.kick(User)
,
Channel.kick(User, String)
@Nonnull public KickCommand target(@Nonnull String target)
target
- targetIllegalArgumentException
- if target is null or contains invalid characters@Nonnull public KickCommand target(@Nonnull User target)
target
- targetIllegalArgumentException
- if target is null or from a different Client@Nonnull public KickCommand reason(@Nullable String reason)
reason
- reason or null to provide no reasonIllegalArgumentException
- if reason contains invalid characterspublic void execute()
execute
in class Command
IllegalStateException
- if target is not defined@Nonnull protected ToStringer toStringer()
Command
ToStringer
for the command.toStringer
in class ChannelCommand
Copyright © 2013–2019 Kitteh. All rights reserved.