Class TimestampFormat

java.lang.Object
hudson.plugins.timestamper.format.TimestampFormat
All Implemented Interfaces:
Function<Timestamp,String>
Direct Known Subclasses:
ElapsedTimestampFormat, EmptyTimestampFormat, SystemTimestampFormat

public abstract class TimestampFormat extends Object implements Function<Timestamp,String>
Format for displaying time-stamps.
Author:
Steven G. Brown
  • Constructor Details

    • TimestampFormat

      public TimestampFormat()
  • Method Details

    • apply

      public abstract String apply(Timestamp timestamp)
      Format the given time-stamp as a string.
      Specified by:
      apply in interface Function<Timestamp,String>
      Returns:
      the formatted time-stamp
    • validate

      public abstract void validate() throws FormatParseException, InvalidHtmlException
      Validates that the given timestamp format can be applied safely.
      Throws:
      FormatParseException - If the timestamp format cannot be parsed
      InvalidHtmlException - If the timestamp format contains invalid HTML
    • markup

      public void markup(MarkupText text, Timestamp timestamp)
      Format the given time-stamp and add it to the mark-up text.
      Parameters:
      text - the mark-up text
      timestamp - the time-stamp to format
    • getPlainTextUrl

      public abstract String getPlainTextUrl()
      Get the URL for displaying the plain text console and time-stamps in this format.
      Returns:
      the plain text URL