Class MapRandomizer
-
- All Implemented Interfaces:
-
io.github.krandom.api.Randomizer
public class MapRandomizer<K, V> implements Randomizer<T>
A Randomizer that generates a Map with random entries.
Mahmoud Ben Hassine ([email protected])
-
-
Constructor Summary
Constructors Constructor Description MapRandomizer(Randomizer<K> keyRandomizer, Randomizer<V> valueRandomizer)
Create a new MapRandomizer with a random number of entries. MapRandomizer(Randomizer<K> keyRandomizer, Randomizer<V> valueRandomizer, int nbEntries)
Create a new MapRandomizer with a fixed number of entries.
-
Method Summary
Modifier and Type Method Description Map<K, V>
getRandomValue()
Generate a random value for the given type. -
-
Constructor Detail
-
MapRandomizer
MapRandomizer(Randomizer<K> keyRandomizer, Randomizer<V> valueRandomizer)
Create a new MapRandomizer with a random number of entries.- Parameters:
keyRandomizer
- the randomizer for keysvalueRandomizer
- the randomizer for values
-
MapRandomizer
MapRandomizer(Randomizer<K> keyRandomizer, Randomizer<V> valueRandomizer, int nbEntries)
Create a new MapRandomizer with a fixed number of entries.- Parameters:
keyRandomizer
- the randomizer for keysvalueRandomizer
- the randomizer for valuesnbEntries
- the number of entries to generate
-
-
Method Detail
-
getRandomValue
Map<K, V> getRandomValue()
Generate a random value for the given type.
- Returns:
a random value for the given type
-
-
-
-