Schnittstelle MapArbitrary<K extends @Nullable Object,V extends @Nullable Object>

Alle Superschnittstellen:
Arbitrary<Map<K,V>>, SizableArbitrary<Map<K,V>>

@API(status=MAINTAINED, since="1.3.2") public interface MapArbitrary<K extends @Nullable Object,V extends @Nullable Object> extends Arbitrary<Map<K,V>>, SizableArbitrary<Map<K,V>>
Fluent interface to add functionality to arbitraries that generate instances of type Map
  • Methodendetails

    • ofSize

      default MapArbitrary<K,V> ofSize(int size)
      Fix the size to size.
      Angegeben von:
      ofSize in Schnittstelle SizableArbitrary<K extends @Nullable Object>
      Parameter:
      size - The size of the generated map
      Gibt zurück:
      new arbitrary instance
    • ofMinSize

      MapArbitrary<K,V> ofMinSize(int minSize)
      Set lower size boundary minSize (included).
      Angegeben von:
      ofMinSize in Schnittstelle SizableArbitrary<K extends @Nullable Object>
      Parameter:
      minSize - The minimum size of the generated map
      Gibt zurück:
      new arbitrary instance
    • ofMaxSize

      MapArbitrary<K,V> ofMaxSize(int maxSize)
      Set upper size boundary maxSize (included).
      Angegeben von:
      ofMaxSize in Schnittstelle SizableArbitrary<K extends @Nullable Object>
      Parameter:
      maxSize - The maximum size of the generated map
      Gibt zurück:
      new arbitrary instance
    • withSizeDistribution

      @API(status=EXPERIMENTAL, since="1.5.3") MapArbitrary<K,V> withSizeDistribution(RandomDistribution uniform)
      Set random distribution distribution of size of generated map. The distribution's center is the minimum size of the generated map.
      Angegeben von:
      withSizeDistribution in Schnittstelle SizableArbitrary<K extends @Nullable Object>
    • uniqueKeys

      @API(status=MAINTAINED, since="1.4.0") MapArbitrary<K,V> uniqueKeys(Function<K,Object> by)
      Add the constraint that keys of the generated map must be unique relating to an element's "feature" being extracted by applying the by function on a map entry's key. The extracted features are being compared using Object.equals(Object).

      The constraint can be combined with other uniqueKeys(Function) constraints.

      Gibt zurück:
      new arbitrary instance
    • uniqueValues

      @API(status=MAINTAINED, since="1.4.0") MapArbitrary<K,V> uniqueValues(Function<V,Object> by)
      Add the constraint that value of the generated map must be unique relating to an element's "feature" being extracted by applying the by function on a map entry's value. The extracted features are being compared using Object.equals(Object).

      The constraint can be combined with other uniqueValues(Function) constraints.

      Gibt zurück:
      new arbitrary instance
    • uniqueValues

      @API(status=MAINTAINED, since="1.4.0") MapArbitrary<K,V> uniqueValues()
      Add the constraint that values of the generated map must be unique, i.e. no two value must return true when being compared using Object.equals(Object).

      The constraint can be combined with other uniqueValues(Function) constraints.

      Gibt zurück:
      new arbitrary instance