public final class ServiceDiscovererUtils
extends Object
ServiceDiscoverer.| Modifier and Type | Class and Description |
|---|---|
static interface |
ServiceDiscovererUtils.TwoIntsConsumer
Represents an operation that accepts two
int-valued arguments and returns no result. |
| Modifier and Type | Method and Description |
|---|---|
static <T> List<ServiceDiscovererEvent<T>> |
calculateDifference(List<? extends T> currentActiveAddresses,
List<? extends T> newActiveAddresses,
Comparator<T> comparator,
ServiceDiscovererUtils.TwoIntsConsumer reporter,
ServiceDiscovererEvent.Status missingRecordStatus)
Given a sorted list of currently active addresses, and a new set of unsorted active address calculate the
ServiceDiscovererEvents. |
@Nullable
public static <T> List<ServiceDiscovererEvent<T>> calculateDifference(List<? extends T> currentActiveAddresses,
List<? extends T> newActiveAddresses,
Comparator<T> comparator,
@Nullable
ServiceDiscovererUtils.TwoIntsConsumer reporter,
ServiceDiscovererEvent.Status missingRecordStatus)
ServiceDiscovererEvents.
newActiveAddresses will be sorted in this method.
T - The type of address.currentActiveAddresses - The currently active addresses.newActiveAddresses - The new list of active addresses.This list must be modifiable as it will be
sorted with List.sort(Comparator).comparator - A comparator for the addresses and to use for binary searches.reporter - A reporter for the numbers of available and missing events.missingRecordStatus - ServiceDiscovererEvent.Status to use for created
ServiceDiscovererEvent when address present in current list but not in the new one.ServiceDiscovererEvents which represents the changes between
currentActiveAddresses and newActiveAddresses, or null if there are no changes.