Class ChangeNotifiers


  • public final class ChangeNotifiers
    extends Object
    • Method Detail

      • isInitialEmptyData

        public static <T> boolean isInitialEmptyData​(Set<T> set)
        Use this to determine if the data you get back from a notifier is the initial result of the result of a proper DNS lookup. This is useful for distinguishing a proper but empty DNS result from the case where a lookup has not completed yet.
        Parameters:
        set -
        Returns:
        true if the input is an initially empty set.
      • aggregate

        public static <T> ChangeNotifier<T> aggregate​(ChangeNotifier<T>... notifiers)
        Creates a ChangeNotifier that aggregates the records provided by a list of notifiers.

        A change event on any of the input notifiers will propagate up the the returned notifier. The set of previous and current records contained in the event will be the union of all records in the input notifiers, before and after the change event.

        Type Parameters:
        T - The record type
        Parameters:
        notifiers - A list of notifiers to aggregate
        Returns:
        A notifier with the described behaviour
      • staticRecords

        public static <T> ChangeNotifier<T> staticRecords​(Set<T> records)