Class MapRandomizer<K,V>
java.lang.Object
org.jeasy.random.randomizers.collection.MapRandomizer<K,V>
- Type Parameters:
K- the type of keysV- the type of values
- All Implemented Interfaces:
Randomizer<Map<K,V>>
A
Randomizer that generates a Map with random entries.- Author:
- Mahmoud Ben Hassine ([email protected])
-
Constructor Summary
ConstructorsConstructorDescriptionMapRandomizer(Randomizer<K> keyRandomizer, Randomizer<V> valueRandomizer) Create a newMapRandomizerwith a random number of entries.MapRandomizer(Randomizer<K> keyRandomizer, Randomizer<V> valueRandomizer, int nbEntries) Create a newMapRandomizerwith a fixed number of entries. -
Method Summary
Modifier and TypeMethodDescriptionGenerate a random value for the given type.
-
Constructor Details
-
MapRandomizer
Create a newMapRandomizerwith a random number of entries.- Parameters:
keyRandomizer- the randomizer for keysvalueRandomizer- the randomizer for values
-
MapRandomizer
Create a newMapRandomizerwith a fixed number of entries.- Parameters:
keyRandomizer- the randomizer for keysvalueRandomizer- the randomizer for valuesnbEntries- the number of entries to generate
-
-
Method Details
-
getRandomValue
Description copied from interface:RandomizerGenerate a random value for the given type.- Specified by:
getRandomValuein interfaceRandomizer<K>- Returns:
- a random value for the given type
-