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 newMapRandomizer
with a random number of entries.MapRandomizer
(Randomizer<K> keyRandomizer, Randomizer<V> valueRandomizer, int nbEntries) Create a newMapRandomizer
with a fixed number of entries. -
Method Summary
Modifier and TypeMethodDescriptionGenerate a random value for the given type.
-
Constructor Details
-
MapRandomizer
Create a newMapRandomizer
with a random number of entries.- Parameters:
keyRandomizer
- the randomizer for keysvalueRandomizer
- the randomizer for values
-
MapRandomizer
Create a newMapRandomizer
with 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:Randomizer
Generate a random value for the given type.- Specified by:
getRandomValue
in interfaceRandomizer<K>
- Returns:
- a random value for the given type
-