Interface PunishmentFormatter


public interface PunishmentFormatter
Contains what little API exists for formatting punishments
  • Method Details

    • formatPunishmentType

      String formatPunishmentType(PunishmentType type)
      Formats a punishment type according to the configuration
      Parameters:
      type - the punishment type to format
      Returns:
      the formatted string
    • formatPunishmentTypeVerb

      String formatPunishmentTypeVerb(PunishmentType type)
      Formats a punishment type as a verb according to the configuration
      Parameters:
      type - the punishment type to format
      Returns:
      the formatted string
    • getTimezone

      ZoneId getTimezone()
      Gets the configured timezone
      Returns:
      the zone id used for displaying dates
    • getDateTimeFormatter

      DateTimeFormatter getDateTimeFormatter()
      Gets the configured date time formatter used for displaying dates
      Returns:
      the date time formatter
    • formatAbsoluteDate

      String formatAbsoluteDate(Instant date)
      Formats an absolute date in conjunction with getTimezone() and getDateTimeFormatter().

      The maximum instant (Instant.MAX) may be passed to indicate a time so far in the future as to be considered the end of a permanent punishment.
      Parameters:
      date - the date to format
      Returns:
      the formatted string
    • formatDuration

      String formatDuration(Duration duration)
      Formats a duration. A zero duration may be passed to represent an infinite or permanent duration.
      Parameters:
      duration - the duration, or zero for a permanent duration
      Returns:
      the formatted string
    • formatScope

      String formatScope(ServerScope scope)
      Formats a server scope according to the configuration
      Parameters:
      scope - the server scope
      Returns:
      the formatted string