|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.github.fge.msgsimple.source.MapMessageSource
public final class MapMessageSource
A Map
-based message source
This is a simple message source using a Map
as a key/value pair to
look up messages.
In order to build such a source, use newBuilder()
. Sample:
final MessageSource source = MapMessageSource.newBuilder() .put("key1", "message1").put("key2", "message2") .putAll(existingMap).build();
Note that null keys or values are not allowed.
MapMessageSource.Builder
Nested Class Summary | |
---|---|
static class |
MapMessageSource.Builder
Builder class for a MapMessageSource |
Method Summary | |
---|---|
String |
getKey(String key)
Return a message matching a given key |
static MapMessageSource.Builder |
newBuilder()
Create a new builder for a map message source |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static MapMessageSource.Builder newBuilder()
MapMessageSource.Builder
public String getKey(String key)
MessageSource
Note that this method MUST return null
if there is no match
for the given key.
Note also that it is guaranteed that you will never get a null key.
getKey
in interface MessageSource
key
- the key
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |