public class GuavaCollectors extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
GuavaCollectors.Factory |
| Constructor and Description |
|---|
GuavaCollectors() |
| Modifier and Type | Method and Description |
|---|---|
static CollectorFactory |
factory() |
static <T> Collector<T,?,com.google.common.collect.ImmutableList<T>> |
toImmutableList() |
static <T> Collector<T,?,com.google.common.collect.ImmutableSet<T>> |
toImmutableSet() |
static <T extends Comparable<T>> |
toImmutableSortedSet() |
static <T> Collector<T,?,com.google.common.collect.ImmutableSortedSet<T>> |
toImmutableSortedSet(Comparator<T> comparator) |
static <T> Collector<T,?,com.google.common.base.Optional<T>> |
toOptional() |
public static <T> Collector<T,?,com.google.common.collect.ImmutableList<T>> toImmutableList()
T - the element type collected.ImmutableList<T>public static <T> Collector<T,?,com.google.common.collect.ImmutableSet<T>> toImmutableSet()
T - the element type collected.ImmutableSet<T>public static <T extends Comparable<T>> Collector<T,?,com.google.common.collect.ImmutableSortedSet<T>> toImmutableSortedSet()
T - the element type collected.ImmutableSortedSet<T>public static <T> Collector<T,?,com.google.common.collect.ImmutableSortedSet<T>> toImmutableSortedSet(Comparator<T> comparator)
T - the element type collected.comparator - the comparator for sorting set elements.ImmutableSortedSet<T> using the given comparator for sortingpublic static <T> Collector<T,?,com.google.common.base.Optional<T>> toOptional()
T - the element type collected.Optional<T>public static CollectorFactory factory()
CollectorFactory which knows how to create all supported Guava typesCopyright © 2016. All rights reserved.