Package org.instancio.generator.hints
Class MapHint.Builder
java.lang.Object
org.instancio.generator.hints.MapHint.Builder
- Enclosing class:
MapHint
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the object.generateEntries(int generateEntries) Indicates how many entries the engine should generate and insert into the map.nullableMapKeys(boolean nullableMapKeys) Indicates whethernulls are allowed to be inserted as map keys.nullableMapValues(boolean nullableMapValues) Indicates whethernulls are allowed to be inserted as map values.<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.<K> MapHint.BuilderThe specified keys will be inserted into the map by the engine during the population process.
-
Method Details
-
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
Indicates whethernulls are allowed to be inserted as map keys.- Parameters:
nullableMapKeys-nullkeys allowed iftrue- Returns:
- builder instance
- Since:
- 2.0.0
-
nullableMapValues
Indicates whethernulls are allowed to be inserted as map values.- Parameters:
nullableMapValues-nullvalues allowed iftrue- Returns:
- builder instance
- Since:
- 2.0.0
-
withEntries
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 typeV- value type- Parameters:
entries- to add- Returns:
- builder instance
- Since:
- 2.0.0
-
withKeys
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
Builds the object.- Returns:
- the built instance.
-