Class TimeFormatter

    • Constructor Summary

      Constructors 
      Constructor Description
      TimeFormatter()
      Constructs a time formatter that uses the default locale and timezone.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.lang.String nonNullFormat​(java.lang.Object value)
      Formats the specified value into a string appropriate for displaying in a table cell.
      TimeFormatter withLocale​(java.util.Locale locale)
      Sets the locale to use for formatting the time.
      TimeFormatter withZone​(java.time.ZoneId zone)
      Sets the time zone to use for formatting the time.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TimeFormatter

        public TimeFormatter()
        Constructs a time formatter that uses the default locale and timezone.
    • Method Detail

      • withLocale

        public TimeFormatter withLocale​(java.util.Locale locale)
        Sets the locale to use for formatting the time.
        Parameters:
        locale - locale to use for formatting
        Returns:
        self, for chaining
      • withZone

        public TimeFormatter withZone​(java.time.ZoneId zone)
        Sets the time zone to use for formatting the time.
        Parameters:
        zone - time zone to use
        Returns:
        self, for chaining
      • nonNullFormat

        protected java.lang.String nonNullFormat​(java.lang.Object value)
        Description copied from class: AbstractCellFormatter
        Formats the specified value into a string appropriate for displaying in a table cell. Note that value is guaranteed to be non-null.
        Specified by:
        nonNullFormat in class AbstractCellFormatter
        Parameters:
        value - the value
        Returns:
        the formatted string