Interface DraftPunishmentBuilder
- All Superinterfaces:
DraftSanctionBuilder<DraftPunishmentBuilder, DraftPunishment>
public interface DraftPunishmentBuilder
extends DraftSanctionBuilder<DraftPunishmentBuilder, DraftPunishment>
Builder of draft punishments. It is required to set the type, victim, and
reason.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds into a full draft punishment.Sets the duration of this builder to the specified one.escalationTrack(EscalationTrack escalationTrack) Sets the escalation track of this builder.Sets the operator of this builder to the specified one.Sets the reason of this builder to the specified one.scope(ServerScope scope) Sets the scope of this builder to the specified one.type(PunishmentType type) Sets the punishment type of this builder to the specified one.Sets the victim of this builder to the specified one.
-
Method Details
-
type
Sets the punishment type of this builder to the specified one. Required operation- Parameters:
type- the type of the punishment- Returns:
- this builder
-
victim
Description copied from interface:DraftSanctionBuilderSets the victim of this builder to the specified one. Required operation.
If the victim is aCompositeVictim, it cannot use eitherCompositeVictim.WILDCARD_UUIDorCompositeVictim.WILDCARD_ADDRESS- Specified by:
victimin interfaceDraftSanctionBuilder<DraftPunishmentBuilder, DraftPunishment>- Parameters:
victim- the victim of the punishmnt- Returns:
- this builder
-
operator
Description copied from interface:DraftSanctionBuilderSets the operator of this builder to the specified one. If unspecified, the console operator is used (ConsoleOperator.INSTANCE)- Specified by:
operatorin interfaceDraftSanctionBuilder<DraftPunishmentBuilder, DraftPunishment>- Parameters:
operator- the operator of the punishment, by default the console- Returns:
- this builder
-
reason
Sets the reason of this builder to the specified one. Required operation- Parameters:
reason- the reason of the punishment- Returns:
- this builder
-
duration
Sets the duration of this builder to the specified one. If unspecified, a duration of zero, indicating a permanent duration, is used- Parameters:
duration- the duration of the punishment, or zero for a permanent punishment- Returns:
- this builder
- Throws:
IllegalArgumentException- ifdurationis negative
-
scope
Sets the scope of this builder to the specified one. If unspecified, the global scope is used- Parameters:
scope- the scope of the punishment- Returns:
- this builder
-
escalationTrack
Sets the escalation track of this builder. If unspecified, no escalation track is used.- Parameters:
escalationTrack- the escalation track, ornullfor none- Returns:
- this builder
-
build
DraftPunishment build()Builds into a full draft punishment. All the required information must be set on this builder.
May be used repeatedly without side effects.- Specified by:
buildin interfaceDraftSanctionBuilder<DraftPunishmentBuilder, DraftPunishment>- Returns:
- a draft punishment from this builder's details
- Throws:
IllegalStateException- if any of the required details on this builder are not setIllegalArgumentException- if the punishment type of this builder isPunishmentType.KICKand the duration is not permanent
-