Interface DurationFormatterFactory

  • All Known Implementing Classes:
    BasicDurationFormatterFactory

    public interface DurationFormatterFactory
    Factory used to construct DurationFormatters. Formatters are immutable once created.

    Setters on the factory mutate the factory and return it, for chaining.

    • Method Detail

      • setPeriodFormatter

        DurationFormatterFactory setPeriodFormatter​(PeriodFormatter formatter)
        Set the period formatter used by the factory. New formatters created with this factory will use the given period formatter.
        Parameters:
        formatter - the formatter to use
        Returns:
        this DurationFormatterFactory
      • setPeriodBuilder

        DurationFormatterFactory setPeriodBuilder​(PeriodBuilder builder)
        Set the builder used by the factory. New formatters created with this factory will use the given locale.
        Parameters:
        builder - the builder to use
        Returns:
        this DurationFormatterFactory
      • setFallback

        DurationFormatterFactory setFallback​(DateFormatter fallback)
        Set a fallback formatter for durations over a given limit.
        Parameters:
        fallback - the fallback formatter to use, or null
        Returns:
        this DurationFormatterFactory
      • setFallbackLimit

        DurationFormatterFactory setFallbackLimit​(long fallbackLimit)
        Set a fallback limit for durations over a given limit.
        Parameters:
        fallbackLimit - the fallback limit to use, or 0 if none is desired.
        Returns:
        this DurationFormatterFactory
      • setLocale

        DurationFormatterFactory setLocale​(java.lang.String localeName)
        Set the name of the locale that will be used when creating new formatters.
        Parameters:
        localeName - the name of the Locale
        Returns:
        this DurationFormatterFactory
      • setTimeZone

        DurationFormatterFactory setTimeZone​(java.util.TimeZone timeZone)
        Set the name of the locale that will be used when creating new formatters.
        Parameters:
        timeZone - The time zone to set.
        Returns:
        this DurationFormatterFactory
      • getFormatter

        DurationFormatter getFormatter()
        Return a formatter based on this factory's current settings.
        Returns:
        a DurationFormatter