Interface PunishmentEditor
public interface PunishmentEditor
Assistant interface for modifying a punishment
-
Method Summary
Modifier and TypeMethodDescriptionvoidextendEndDate(Duration endDateDelta) Modifies the end date by adding the given duration.voidsetEndDate(Instant endDate) Sets the new end date.voidsetEscalationTrack(EscalationTrack escalationTrack) Sets the new escalation track, ornullfor nonevoidSets the new reasonvoidsetScope(ServerScope scope) Sets the new scope
-
Method Details
-
setReason
-
setScope
-
setEndDate
Sets the new end date.Punishment.PERMANENT_END_DATEis used for a permanent punishment- Parameters:
endDate- the new end date- Throws:
IllegalStateException- ifextendEndDate(Duration)was used
-
extendEndDate
Modifies the end date by adding the given duration.
It is possible to reduce the end date by using a negative duration. Note that if the subtraction operation would otherwise cause the punishment to have an end date less than or equal to the start date, then 1 second plus the start date is used as the new end date.- Parameters:
endDateDelta- the amount by which to change the end date, may be negative- Throws:
IllegalStateException- ifsetEndDate(Instant)was used
-
setEscalationTrack
Sets the new escalation track, ornullfor none- Parameters:
escalationTrack- the new escalation track or null to clear the track
-