Class AggregatingConverter.Builder

    • Method Detail

      • aggregates

        public AggregatingConverter.Builder aggregates​(IConverter... converters)
        Registers the given converters for delegation for the built converter.
        Parameters:
        converters - The additional converters to delegate to.
        Returns:
        This builder instance.
      • aggregates

        public AggregatingConverter.Builder aggregates​(Collection<? extends IConverter> converters)
        Registers the given converters for delegation for the built converter.
        Parameters:
        converters - The additional converters to delegate to.
        Returns:
        This builder instance.
      • callback

        public AggregatingConverter.Builder callback​(IConverterFailureCallback converterFailureCallback)
        Registers a callback that is invoked when a converter is failing. Any previously registered callback is removed.
        Parameters:
        converterFailureCallback - The callback to notify over failed conversions.
        Returns:
        This builder instance.
      • selectionStrategy

        public AggregatingConverter.Builder selectionStrategy​(ISelectionStrategy selectionStrategy)
        Registers a strategy for selecting one of several converters that this instance aggregates. By default, the build converter applies a round-robin aggregation strategy.
        Parameters:
        selectionStrategy - The selection strategy to apply.
        Returns:
        This builder instance.
      • propagateShutDown

        public AggregatingConverter.Builder propagateShutDown​(boolean propagateShutDown)
        Parameters:
        propagateShutDown - true if shutting down this converter should also shut down any aggregated converters.
        Returns:
        This builder instance.
      • build

        public IAggregatingConverter build()
        Creates the specified converter.
        Returns:
        The specified converter.
      • build

        public IAggregatingConverter build​(ScheduledExecutorService executorService,
                                           long delay,
                                           TimeUnit timeUnit)
        Creates the specified converter and additionally registers a job to regularly investigate any aggregated converter for its functionality. If a converter proves to no longer be operational, it is removed as if a conversion had failed.
        Parameters:
        executorService - The executor service to run the regular check.
        delay - The delay between checks.
        timeUnit - The time unit of the delay.
        Returns:
        The specified converter.