protected Set<Interest<InstanceInfo>> getBasicInterests(Interest<InstanceInfo> newInterests) { Set<Interest<InstanceInfo>> basicInterests; if (newInterests instanceof MultipleInterests) { basicInterests = ((MultipleInterests<InstanceInfo>) newInterests).flatten(); } else { basicInterests = Collections.singleton(newInterests); } return basicInterests; } }
protected Set<Interest<InstanceInfo>> getBasicInterests(Interest<InstanceInfo> newInterests) { Set<Interest<InstanceInfo>> basicInterests; if (newInterests instanceof MultipleInterests) { basicInterests = ((MultipleInterests<InstanceInfo>) newInterests).flatten(); } else { basicInterests = Collections.singleton(newInterests); } return basicInterests; } }
public InterestRegistration(Interest<InstanceInfo> interest) { if (interest instanceof MultipleInterests) { Set<Interest<InstanceInfo>> set = ((MultipleInterests<InstanceInfo>) interest).flatten(); interests = set.toArray(new Interest[set.size()]); } else { interests = new Interest[]{interest}; } }
@Override public void retainAll(Interest<T> interest) { Set<Interest<T>> toKeep; if (interest instanceof MultipleInterests) { toKeep = ((MultipleInterests<T>) interest).flatten(); } else { toKeep = Collections.singleton(interest); } interestsBufferingState.keySet().retainAll(toKeep); }
@Override public Observable<ChangeNotification<T>> forCompositeInterest( MultipleInterests<T> interest, SourcedEurekaRegistry<T> registry ) { List<Observable<ChangeNotification<T>>> indexes = new ArrayList<>(); for (Interest<T> atomicInterest : interest.flatten()) { indexes.add(registry.forInterest(atomicInterest)); } return Observable.merge(indexes); }
public MultipleInterests<T> copyAndRemove(Interest<T> toAppend) { Set<Interest<T>> newInterests = flatten(); // flatten does the copy of the underlying set remove(toAppend, newInterests); return new MultipleInterests<>(newInterests); }
public MultipleInterests<T> copyAndAppend(Interest<T> toAppend) { Set<Interest<T>> newInterests = flatten(); // flatten does the copy of the underlying set append(toAppend, newInterests); return new MultipleInterests<>(newInterests); }
Set<Interest<InstanceInfo>> newInterestSet = ((MultipleInterests<InstanceInfo>) newInterest).flatten();
Set<Interest<InstanceInfo>> newInterestSet = ((MultipleInterests<InstanceInfo>) newInterest).flatten();
if (multiple.flatten().isEmpty()) { return Observable.empty();