Package org.opensearch.common.util.set
Class Sets
java.lang.Object
org.opensearch.common.util.set.Sets
OpenSearch sets.
- Opensearch.internal:
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Set<T>difference(Set<T> left, Set<T> right) The relative complement, or difference, of the specified left and right set.static <T> booleanhaveEmptyIntersection(Set<T> left, Set<T> right) static <T> Set<T>intersection(Set<T> set1, Set<T> set2) static <T> Set<T>static <T> HashSet<T>newHashSet(Iterable<T> iterable) static <T> HashSet<T>newHashSet(Iterator<T> iterator) static <T> HashSet<T>newHashSet(T... elements) static <T> SortedSet<T>sortedDifference(Set<T> left, Set<T> right) The relative complement, or difference, of the specified left and right set, returned as a sorted set.static <T> Set<T>
-
Method Details
-
newHashSet
-
newHashSet
-
newHashSet
-
newConcurrentHashSet
-
haveEmptyIntersection
-
difference
The relative complement, or difference, of the specified left and right set. Namely, the resulting set contains all the elements that are in the left set but not in the right set. Neither input is mutated by this operation, an entirely new set is returned.- Type Parameters:
T- the type of the elements of the sets- Parameters:
left- the left setright- the right set- Returns:
- the relative complement of the left set with respect to the right set
-
sortedDifference
The relative complement, or difference, of the specified left and right set, returned as a sorted set. Namely, the resulting set contains all the elements that are in the left set but not in the right set, and the set is sorted using the natural ordering of element type. Neither input is mutated by this operation, an entirely new set is returned.- Type Parameters:
T- the type of the elements of the sets- Parameters:
left- the left setright- the right set- Returns:
- the sorted relative complement of the left set with respect to the right set
-
union
-
intersection
-