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.static MapHint.Builder
builder()
generateEntries
(int generateEntries) Indicates how many entries the engine should generate and insert into the map.nullableMapKeys
(boolean nullableMapKeys) Indicates whethernull
s are allowed to be inserted as map keys.nullableMapValues
(boolean nullableMapValues) Indicates whethernull
s 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.Builder
The specified keys will be inserted into the map by the engine during the population process.
-
Method Details
-
builder
-
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 whethernull
s are allowed to be inserted as map keys.- Parameters:
nullableMapKeys
-null
keys allowed iftrue
- Returns:
- builder instance
- Since:
- 2.0.0
-
nullableMapValues
Indicates whethernull
s are allowed to be inserted as map values.- Parameters:
nullableMapValues
-null
values 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.
-