public static final class MapMessageSource.Builder
extends java.lang.Object
MapMessageSource
Modifier and Type | Method and Description |
---|---|
MessageSource |
build()
Build a new message source from the contents of this builder
|
MapMessageSource.Builder |
put(java.lang.String key,
java.lang.String message)
Add one key/message pair
|
MapMessageSource.Builder |
putAll(java.util.Map<java.lang.String,java.lang.String> map)
Add a map of key/message pairs
|
public MapMessageSource.Builder put(java.lang.String key, java.lang.String message)
This overrides the value if the key already existed.
key
- the keymessage
- the messagejava.lang.NullPointerException
- either the key or the value is nullpublic MapMessageSource.Builder putAll(java.util.Map<java.lang.String,java.lang.String> map)
This overrides all values of already existing keys.
map
- the mapjava.lang.NullPointerException
- the map is null; or a key, or value, is
nullpublic MessageSource build()
MapMessageSource