Class MultimapTestSuiteBuilder.ReserializedMultimapGenerator<K,V,M extends Multimap<K,V>>
- java.lang.Object
-
- com.google.common.collect.testing.google.MultimapTestSuiteBuilder.ReserializedMultimapGenerator<K,V,M>
-
- All Implemented Interfaces:
TestMultimapGenerator<K,V,M>,TestContainerGenerator<M,java.util.Map.Entry<K,V>>
private static class MultimapTestSuiteBuilder.ReserializedMultimapGenerator<K,V,M extends Multimap<K,V>> extends java.lang.Object implements TestMultimapGenerator<K,V,M>
-
-
Field Summary
Fields Modifier and Type Field Description private OneSizeTestContainerGenerator<M,java.util.Map.Entry<K,V>>multimapGenerator
-
Constructor Summary
Constructors Constructor Description ReserializedMultimapGenerator(OneSizeTestContainerGenerator<M,java.util.Map.Entry<K,V>> multimapGenerator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Mcreate(java.lang.Object... elements)Creates a new container containing the given elements.java.util.Map.Entry<K,V>[]createArray(int length)Helper method to create an array of the appropriate type used by this generator.java.util.Collection<V>createCollection(java.lang.Iterable<? extends V> values)K[]createKeyArray(int length)V[]createValueArray(int length)java.lang.Iterable<java.util.Map.Entry<K,V>>order(java.util.List<java.util.Map.Entry<K,V>> insertionOrder)Returns the iteration ordering of elements, given the order in which they were added to the container.SampleElements<K>sampleKeys()SampleElements<java.util.Map.Entry<K,V>>samples()Returns the sample elements that this generate populates its container with.SampleElements<V>sampleValues()
-
-
-
Constructor Detail
-
ReserializedMultimapGenerator
public ReserializedMultimapGenerator(OneSizeTestContainerGenerator<M,java.util.Map.Entry<K,V>> multimapGenerator)
-
-
Method Detail
-
samples
public SampleElements<java.util.Map.Entry<K,V>> samples()
Description copied from interface:TestContainerGeneratorReturns the sample elements that this generate populates its container with.- Specified by:
samplesin interfaceTestContainerGenerator<K,V>
-
createArray
public java.util.Map.Entry<K,V>[] createArray(int length)
Description copied from interface:TestContainerGeneratorHelper method to create an array of the appropriate type used by this generator. The returned array will contain only nulls.- Specified by:
createArrayin interfaceTestContainerGenerator<K,V>
-
order
public java.lang.Iterable<java.util.Map.Entry<K,V>> order(java.util.List<java.util.Map.Entry<K,V>> insertionOrder)
Description copied from interface:TestContainerGeneratorReturns the iteration ordering of elements, given the order in which they were added to the container. This method may return the original list unchanged, the original list modified in place, or a different list.If the order is non-deterministic, as with
HashSet, this method can return its input unmodified. Provided that the test suite is built withoutCollectionFeature.KNOWN_ORDER, the tests will look only at the returned contents without regard for order.- Specified by:
orderin interfaceTestContainerGenerator<K,V>
-
create
public M create(java.lang.Object... elements)
Description copied from interface: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.- Specified by:
createin interfaceTestContainerGenerator<K,V>
-
createKeyArray
public K[] createKeyArray(int length)
- Specified by:
createKeyArrayin interfaceTestMultimapGenerator<K,V,M extends Multimap<K,V>>
-
createValueArray
public V[] createValueArray(int length)
- Specified by:
createValueArrayin interfaceTestMultimapGenerator<K,V,M extends Multimap<K,V>>
-
sampleKeys
public SampleElements<K> sampleKeys()
- Specified by:
sampleKeysin interfaceTestMultimapGenerator<K,V,M extends Multimap<K,V>>
-
sampleValues
public SampleElements<V> sampleValues()
- Specified by:
sampleValuesin interfaceTestMultimapGenerator<K,V,M extends Multimap<K,V>>
-
createCollection
public java.util.Collection<V> createCollection(java.lang.Iterable<? extends V> values)
- Specified by:
createCollectionin interfaceTestMultimapGenerator<K,V,M extends Multimap<K,V>>
-
-