Java Code Examples for java.util.stream.Collectors#toSet()

The following examples show how to use java.util.stream.Collectors#toSet() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Collector<Integer, ?, ? extends Collection<Integer>> getCollector(Map<?, ?> m) {
    Collector<Integer, ?, ? extends Collection<Integer>> collector = m instanceof LinkedHashMap
                                                                     ? Collectors.toList()
                                                                     : Collectors.toSet();
    return collector;
}
 
Example 2
Collector<Integer, ?, ? extends Collection<Integer>> getCollector(Map<?, ?> m) {
    Collector<Integer, ?, ? extends Collection<Integer>> collector = m instanceof LinkedHashMap
                                                                     ? Collectors.toList()
                                                                     : Collectors.toSet();
    return collector;
}
 
Example 3
Collector<Integer, ?, ? extends Collection<Integer>> getCollector(Map<?, ?> m) {
    Collector<Integer, ?, ? extends Collection<Integer>> collector = m instanceof LinkedHashMap
                                                                     ? Collectors.toList()
                                                                     : Collectors.toSet();
    return collector;
}
 
Example 4
Source Project: sailfish-core   File: IterableConverter.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public <T> Collector<T, ?, Set<T>> collector() {
    return Collectors.toSet();
}
 
Example 5
Collector<Integer, ?, ? extends Collection<Integer>> getCollector(Map<?, ?> m) {
    Collector<Integer, ?, ? extends Collection<Integer>> collector = m instanceof LinkedHashMap
                                                                     ? Collectors.toList()
                                                                     : Collectors.toSet();
    return collector;
}
 
Example 6
Collector<Integer, ?, ? extends Collection<Integer>> getCollector(Map<?, ?> m) {
    Collector<Integer, ?, ? extends Collection<Integer>> collector = m instanceof LinkedHashMap
                                                                     ? Collectors.toList()
                                                                     : Collectors.toSet();
    return collector;
}
 
Example 7
Collector<Integer, ?, ? extends Collection<Integer>> getCollector(Map<?, ?> m) {
    Collector<Integer, ?, ? extends Collection<Integer>> collector = m instanceof LinkedHashMap
                                                                     ? Collectors.toList()
                                                                     : Collectors.toSet();
    return collector;
}
 
Example 8
Collector<Integer, ?, ? extends Collection<Integer>> getCollector(Map<?, ?> m) {
    Collector<Integer, ?, ? extends Collection<Integer>> collector = m instanceof LinkedHashMap
                                                                     ? Collectors.toList()
                                                                     : Collectors.toSet();
    return collector;
}
 
Example 9
Collector<Integer, ?, ? extends Collection<Integer>> getCollector(Map<?, ?> m) {
    Collector<Integer, ?, ? extends Collection<Integer>> collector = m instanceof LinkedHashMap
                                                                     ? Collectors.toList()
                                                                     : Collectors.toSet();
    return collector;
}
 
Example 10
Collector<Integer, ?, ? extends Collection<Integer>> getCollector(Map<?, ?> m) {
    Collector<Integer, ?, ? extends Collection<Integer>> collector = m instanceof LinkedHashMap
                                                                     ? Collectors.toList()
                                                                     : Collectors.toSet();
    return collector;
}
 
Example 11
Collector<Integer, ?, ? extends Collection<Integer>> getCollector(Map<?, ?> m) {
    Collector<Integer, ?, ? extends Collection<Integer>> collector = m instanceof LinkedHashMap
                                                                     ? Collectors.toList()
                                                                     : Collectors.toSet();
    return collector;
}
 
Example 12
Collector<Integer, ?, ? extends Collection<Integer>> getCollector(Map<?, ?> m) {
    Collector<Integer, ?, ? extends Collection<Integer>> collector = m instanceof LinkedHashMap
                                                                     ? Collectors.toList()
                                                                     : Collectors.toSet();
    return collector;
}
 
Example 13
Collector<Integer, ?, ? extends Collection<Integer>> getCollector(Map<?, ?> m) {
    Collector<Integer, ?, ? extends Collection<Integer>> collector = m instanceof LinkedHashMap
                                                                     ? Collectors.toList()
                                                                     : Collectors.toSet();
    return collector;
}
 
Example 14
Source Project: cyclops   File: HashSet.java    License: Apache License 2.0 4 votes vote down vote up
static <T> Collector<T, Set<T>, HashSet<T>> collector() {
    Collector<T, ?, Set<T>> c  = Collectors.toSet();
    return Collectors.<T, Set<T>, Iterable<T>,HashSet<T>>collectingAndThen((Collector)c,HashSet::fromIterable);
}
 
Example 15
Source Project: cyclops   File: TreeSet.java    License: Apache License 2.0 4 votes vote down vote up
static <T extends Comparable<? super T>>  Collector<T, Set<T>, TreeSet<T>> collector() {
    Collector<T, ?, Set<T>> c  = Collectors.toSet();
    return Collectors.<T, Set<T>, Iterable<T>,TreeSet<T>>collectingAndThen((Collector)c,TreeSet::fromIterable);
}
 
Example 16
Source Project: cyclops   File: TrieSet.java    License: Apache License 2.0 4 votes vote down vote up
static <T> Collector<T, Set<T>, TrieSet<T>> collector() {
    Collector<T, ?, Set<T>> c  = Collectors.toSet();
    return Collectors.<T, Set<T>, Iterable<T>,TrieSet<T>>collectingAndThen((Collector)c,TrieSet::fromIterable);
}
 
Example 17
Collector<Integer, ?, ? extends Collection<Integer>> getCollector(Map<?, ?> m) {
    Collector<Integer, ?, ? extends Collection<Integer>> collector = m instanceof LinkedHashMap
                                                                     ? Collectors.toList()
                                                                     : Collectors.toSet();
    return collector;
}
 
Example 18
Source Project: essentials4j   File: To.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Returns a {@code Collector} that accumulates the input elements into a new {@code Set}.
 * <p>
 * A shortcut for: {@code Collectors.toSet()}.
 *
 * @param <T> the type of the output set elements
 * @return a new collector that accumulates the input elements into a new {@code Set}
 * @see Collectors#toSet()
 */
public static <T> Collector<T, ?, Set<T>> set() {
	return Collectors.toSet();
}