Interface PunishmentEditor


public interface PunishmentEditor
Assistant interface for modifying a punishment
  • Method Details

    • setReason

      void setReason(String reason)
      Sets the new reason
      Parameters:
      reason - the new reason
    • setScope

      void setScope(ServerScope scope)
      Sets the new scope
      Parameters:
      scope - the new scope
    • setEndDate

      void setEndDate(Instant endDate)
      Sets the new end date. Punishment.PERMANENT_END_DATE is used for a permanent punishment
      Parameters:
      endDate - the new end date
      Throws:
      IllegalStateException - if extendEndDate(Duration) was used
    • extendEndDate

      void extendEndDate(Duration endDateDelta)
      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 - if setEndDate(Instant) was used
    • setEscalationTrack

      void setEscalationTrack(EscalationTrack escalationTrack)
      Sets the new escalation track, or null for none
      Parameters:
      escalationTrack - the new escalation track or null to clear the track