Package org.elasticsearch.core
Class Set
java.lang.Object
org.elasticsearch.core.Set
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Set<T>copyOf(Collection<? extends T> coll)Returns an unmodifiableSetcontaining the elements of the given Collection.static <T> Set<T>of()Returns an unmodifiable set containing zero elements.static <T> Set<T>of(T e1)Returns an unmodifiable set containing one element.static <T> Set<T>of(T... entries)Returns an unmodifiable set containing an arbitrary number of elements.static <T> Set<T>of(T e1, T e2)Returns an unmodifiable set containing two elements.
-
Constructor Details
-
Set
public Set()
-
-
Method Details
-
of
Returns an unmodifiable set containing zero elements.- Type Parameters:
T- theSet's element type- Returns:
- an empty
Set
-
of
Returns an unmodifiable set containing one element.- Type Parameters:
T- theSet's element type- Parameters:
e1- the single element- Returns:
- a
Setcontaining the specified element
-
of
Returns an unmodifiable set containing two elements.- Type Parameters:
T- theSet's element type- Parameters:
e1- the first elemente2- the second element- Returns:
- a
Setcontaining the specified element
-
of
Returns an unmodifiable set containing an arbitrary number of elements.- Type Parameters:
T- theSet's element type- Parameters:
entries- the elements to be contained in the set- Returns:
- an unmodifiable set containing the specified elements.
-
copyOf
Returns an unmodifiableSetcontaining the elements of the given Collection.- Type Parameters:
T- theSet's element type- Parameters:
coll- aCollectionfrom which elements are drawn, must be non-null- Returns:
- a
Setcontaining the elements of the givenCollection - Throws:
NullPointerException- if coll is null, or if it contains any nulls- Since:
- 10
-