Class MapHint.Builder

java.lang.Object
org.instancio.generator.hints.MapHint.Builder
Enclosing class:
MapHint

public static final class MapHint.Builder extends Object
Builder class for this hint.
  • Method Details

    • generateEntries

      public MapHint.Builder generateEntries(int generateEntries)
      Indicates how many entries the engine should generate and insert into the map.
      Parameters:
      generateEntries - size of the map
      Returns:
      builder instance
      Since:
      2.0.0
    • nullableMapKeys

      public MapHint.Builder nullableMapKeys(boolean nullableMapKeys)
      Indicates whether nulls are allowed to be inserted as map keys.
      Parameters:
      nullableMapKeys - null keys allowed if true
      Returns:
      builder instance
      Since:
      2.0.0
    • nullableMapValues

      public MapHint.Builder nullableMapValues(boolean nullableMapValues)
      Indicates whether nulls are allowed to be inserted as map values.
      Parameters:
      nullableMapValues - null values allowed if true
      Returns:
      builder instance
      Since:
      2.0.0
    • withEntries

      public <K, V> MapHint.Builder withEntries(Map<? extends K,? extends V> entries)
      The specified entries will be inserted into the map by the engine during the population process. This method can be invoked more than once.
      Type Parameters:
      K - key type
      V - value type
      Parameters:
      entries - to add
      Returns:
      builder instance
      Since:
      2.0.0
    • withKeys

      public <K> MapHint.Builder withKeys(List<? extends K> keys)
      The specified keys will be inserted into the map by the engine during the population process. This method can be invoked more than once.
      Type Parameters:
      K - key type
      Parameters:
      keys - to add
      Returns:
      builder instance
      Since:
      2.0.0
    • build

      public MapHint build()
      Builds the object.
      Returns:
      the built instance.