Package com.google.common.testing
Enum CollectorTester.CollectStrategy
- java.lang.Object
-
- java.lang.Enum<CollectorTester.CollectStrategy>
-
- com.google.common.testing.CollectorTester.CollectStrategy
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<CollectorTester.CollectStrategy>
- Enclosing class:
- CollectorTester<T,A,R>
static enum CollectorTester.CollectStrategy extends java.lang.Enum<CollectorTester.CollectStrategy>
Different orderings for combining the elements of an input array, which must all produce the same result.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description MERGE_LEFT_ASSOCIATIVE
Get one accumulator for each element and merge the accumulators left-to-right.MERGE_RIGHT_ASSOCIATIVE
Get one accumulator for each element and merge the accumulators right-to-left.SEQUENTIAL
Get one accumulator and accumulate the elements into it sequentially.
-
Constructor Summary
Constructors Modifier Constructor Description private
CollectStrategy()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description (package private) abstract <T,A,R>
Aresult(java.util.stream.Collector<T,A,R> collector, java.lang.Iterable<T> inputs)
static CollectorTester.CollectStrategy
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static CollectorTester.CollectStrategy[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
SEQUENTIAL
public static final CollectorTester.CollectStrategy SEQUENTIAL
Get one accumulator and accumulate the elements into it sequentially.
-
MERGE_LEFT_ASSOCIATIVE
public static final CollectorTester.CollectStrategy MERGE_LEFT_ASSOCIATIVE
Get one accumulator for each element and merge the accumulators left-to-right.
-
MERGE_RIGHT_ASSOCIATIVE
public static final CollectorTester.CollectStrategy MERGE_RIGHT_ASSOCIATIVE
Get one accumulator for each element and merge the accumulators right-to-left.
-
-
Method Detail
-
values
public static CollectorTester.CollectStrategy[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (CollectorTester.CollectStrategy c : CollectorTester.CollectStrategy.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static CollectorTester.CollectStrategy valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
result
abstract <T,A,R> A result(java.util.stream.Collector<T,A,R> collector, java.lang.Iterable<T> inputs)
-
-