com.github.fge.msgsimple.source
Class MapMessageSource.Builder

java.lang.Object
  extended by com.github.fge.msgsimple.source.MapMessageSource.Builder
Enclosing class:
MapMessageSource

public static final class MapMessageSource.Builder
extends Object

Builder class for a MapMessageSource


Method Summary
 MessageSource build()
          Build a new message source from the contents of this builder
 MapMessageSource.Builder put(String key, String message)
          Add one key/message pair
 MapMessageSource.Builder putAll(Map<String,String> map)
          Add a map of key/message pairs
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

put

public MapMessageSource.Builder put(String key,
                                    String message)
Add one key/message pair

This overrides the value if the key already existed.

Parameters:
key - the key
message - the message
Returns:
this
Throws:
NullPointerException - either the key or the value is null

putAll

public MapMessageSource.Builder putAll(Map<String,String> map)
Add a map of key/message pairs

This overrides all values of already existing keys.

Parameters:
map - the map
Returns:
this
Throws:
NullPointerException - the map is null; or a key, or value, is null

build

public MessageSource build()
Build a new message source from the contents of this builder

Returns:
a MapMessageSource