Interface PeriodFormatterFactory

  • All Known Implementing Classes:
    BasicPeriodFormatterFactory

    public interface PeriodFormatterFactory
    Abstract factory interface used to create PeriodFormatters. PeriodFormatters are immutable once created.

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

    • Method Detail

      • setLocale

        PeriodFormatterFactory 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 PeriodFormatterFactory
      • setDisplayLimit

        PeriodFormatterFactory setDisplayLimit​(boolean display)
        Set whether limits will be displayed.
        Parameters:
        display - true if limits will be displayed
        Returns:
        this PeriodFormatterFactory
      • setDisplayPastFuture

        PeriodFormatterFactory setDisplayPastFuture​(boolean display)
        Set whether past and future will be displayed.
        Parameters:
        display - true if past and future will be displayed
        Returns:
        this PeriodFormatterFactory
      • setSeparatorVariant

        PeriodFormatterFactory setSeparatorVariant​(int variant)
        Set how separators will be displayed.
        Parameters:
        variant - the variant indicating how separators will be displayed
        Returns:
        this PeriodFormatterFactory
      • setUnitVariant

        PeriodFormatterFactory setUnitVariant​(int variant)
        Set the variant of the time unit names to use.
        Parameters:
        variant - the variant to use
        Returns:
        this PeriodFormatterFactory
      • setCountVariant

        PeriodFormatterFactory setCountVariant​(int variant)
        Set the variant of the count to use.
        Parameters:
        variant - the variant to use
        Returns:
        this PeriodFormatterFactory
      • getFormatter

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