@GwtCompatible public abstract class TestEnumSetGenerator extends Object implements TestSetGenerator<AnEnum>
An abstract TestSetGenerator for generating sets containing enum values.
| Constructor and Description |
|---|
TestEnumSetGenerator() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract Set<AnEnum> |
create(AnEnum[] elements) |
Set<AnEnum> |
create(Object... elements)
Creates a new container containing the given elements.
|
AnEnum[] |
createArray(int length)
Helper method to create an array of the appropriate type used by this generator.
|
List<AnEnum> |
order(List<AnEnum> insertionOrder)
Sorts the enums according to their natural ordering.
|
SampleElements<AnEnum> |
samples()
Returns the sample elements that this generate populates its container with.
|
public SampleElements<AnEnum> samples()
TestContainerGeneratorReturns the sample elements that this generate populates its container with.
samples in interface TestContainerGenerator<Collection<AnEnum>,AnEnum>public Set<AnEnum> create(Object... elements)
TestContainerGeneratorCreates a new container containing the given elements. TODO: would be nice to figure out how to use E… or E[] as a parameter type, but this doesn’t seem to work because Java creates an array of the erased type.
create in interface TestContainerGenerator<Collection<AnEnum>,AnEnum>create in interface TestSetGenerator<AnEnum>public AnEnum[] createArray(int length)
TestContainerGeneratorHelper method to create an array of the appropriate type used by this generator. The returned array will contain only nulls.
createArray in interface TestContainerGenerator<Collection<AnEnum>,AnEnum>public List<AnEnum> order(List<AnEnum> insertionOrder)
Sorts the enums according to their natural ordering.
order in interface TestContainerGenerator<Collection<AnEnum>,AnEnum>