Class DerivedGoogleCollectionGenerators.InverseBiMapGenerator<K extends @Nullable Object,V extends @Nullable Object>
- java.lang.Object
-
- com.google.common.collect.testing.google.DerivedGoogleCollectionGenerators.InverseBiMapGenerator<K,V>
-
- All Implemented Interfaces:
DerivedGenerator,TestBiMapGenerator<V,K>,TestContainerGenerator<com.google.common.collect.BiMap<V,K>,Map.Entry<V,K>>
- Enclosing class:
- DerivedGoogleCollectionGenerators
public static class DerivedGoogleCollectionGenerators.InverseBiMapGenerator<K extends @Nullable Object,V extends @Nullable Object> extends Object implements TestBiMapGenerator<V,K>, DerivedGenerator
-
-
Constructor Summary
Constructors Constructor Description InverseBiMapGenerator(OneSizeTestContainerGenerator<com.google.common.collect.BiMap<K,V>,Map.Entry<K,V>> oneSizeTestContainerGenerator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.common.collect.BiMap<V,K>create(Object... elements)Creates a new container containing the given elements.Map.Entry<V,K>[]createArray(int length)Helper method to create an array of the appropriate type used by this generator.V[]createKeyArray(int length)K[]createValueArray(int length)TestSubjectGenerator<?>getInnerGenerator()Iterable<Map.Entry<V,K>>order(List<Map.Entry<V,K>> insertionOrder)Returns the iteration ordering of elements, given the order in which they were added to the container.SampleElements<Map.Entry<V,K>>samples()Returns the sample elements that this generate populates its container with.
-
-
-
Constructor Detail
-
InverseBiMapGenerator
public InverseBiMapGenerator(OneSizeTestContainerGenerator<com.google.common.collect.BiMap<K,V>,Map.Entry<K,V>> oneSizeTestContainerGenerator)
-
-
Method Detail
-
samples
public SampleElements<Map.Entry<V,K>> samples()
Description copied from interface:TestContainerGeneratorReturns the sample elements that this generate populates its container with.
-
create
public com.google.common.collect.BiMap<V,K> create(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.
-
createArray
public Map.Entry<V,K>[] 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 extends @Nullable Object,V extends @Nullable Object>
-
order
public Iterable<Map.Entry<V,K>> order(List<Map.Entry<V,K>> 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.
-
createKeyArray
public V[] createKeyArray(int length)
- Specified by:
createKeyArrayin interfaceTestBiMapGenerator<K extends @Nullable Object,V extends @Nullable Object>
-
createValueArray
public K[] createValueArray(int length)
- Specified by:
createValueArrayin interfaceTestBiMapGenerator<K extends @Nullable Object,V extends @Nullable Object>
-
getInnerGenerator
public TestSubjectGenerator<?> getInnerGenerator()
- Specified by:
getInnerGeneratorin interfaceDerivedGenerator
-
-