Class MapsDSL.MapGeneratorBuilder<K,​V>

  • Type Parameters:
    K - key type to generate
    V - value type to generate
    Enclosing class:
    MapsDSL

    public static class MapsDSL.MapGeneratorBuilder<K,​V>
    extends Object
    MapGeneratorBuilder enables the creation of Sources for Maps of fixed and bounded size, where no Collector is specified. A MapGeneratorBuilder can be used to create a TypedListGeneratorBuilder, where the Collector is specified.
    • Constructor Detail

      • MapGeneratorBuilder

        public MapGeneratorBuilder​(org.quicktheories.core.Gen<K> kg,
                                   org.quicktheories.core.Gen<V> vg)
    • Method Detail

      • ofSize

        public org.quicktheories.core.Gen<Map<K,​V>> ofSize​(int size)
        Generates a Map of objects, where the size of the Map is fixed
        Parameters:
        size - size of lists to generate
        Returns:
        a Source of Maps of type K,V
      • ofSizeBetween

        public org.quicktheories.core.Gen<Map<K,​V>> ofSizeBetween​(int minSize,
                                                                        int maxSize)
        Generates a Map of objects, where the size of the Map is bounded by minimumSize and maximumSize
        Parameters:
        minSize - inclusive minimum size of Map
        maxSize - inclusive maximum size of Map
        Returns:
        a Source of Maps of type T
      • ofSizes

        public org.quicktheories.core.Gen<Map<K,​V>> ofSizes​(org.quicktheories.core.Gen<Integer> sizes)
        Generates a Map of objects with sizes drawn from sizes gen
        Parameters:
        sizes - Sizes of maps to generate
        Returns:
        A Source of Maps of Type T