Class MapRandomizer<K,​V>

  • Type Parameters:
    K - the type of keys
    V - the type of values
    All Implemented Interfaces:
    Randomizer<java.util.Map<K,​V>>

    public class MapRandomizer<K,​V>
    extends java.lang.Object
    implements Randomizer<java.util.Map<K,​V>>
    A Randomizer that generates a Map with random entries.
    Author:
    Mahmoud Ben Hassine (mahmoud.benhassine@icloud.com)
    • Constructor Detail

      • MapRandomizer

        public MapRandomizer​(Randomizer<K> keyRandomizer,
                             Randomizer<V> valueRandomizer)
        Create a new MapRandomizer with a random number of entries.
        Parameters:
        keyRandomizer - the randomizer for keys
        valueRandomizer - the randomizer for values
      • MapRandomizer

        public MapRandomizer​(Randomizer<K> keyRandomizer,
                             Randomizer<V> valueRandomizer,
                             int nbEntries)
        Create a new MapRandomizer with a fixed number of entries.
        Parameters:
        keyRandomizer - the randomizer for keys
        valueRandomizer - the randomizer for values
        nbEntries - the number of entries to generate
    • Method Detail

      • getRandomValue

        public java.util.Map<K,​V> getRandomValue()
        Description copied from interface: Randomizer
        Generate a random value for the given type.
        Specified by:
        getRandomValue in interface Randomizer<K>
        Returns:
        a random value for the given type