public abstract class MsgFormatter extends Object
{} characters.
See the next correct asserts:
assertEquals("TEST" , MsgFormatter.format("TE{}T", "S"));
assertEquals("TE, S, T", MsgFormatter.format("TE", "S", "T"));
assertEquals("TES{}" , MsgFormatter.format("TE{}{}", "S"));
| Modifier and Type | Field and Description |
|---|---|
protected static String |
MARK
Parameter mark
|
protected static String |
SEPARATOR
Separator
|
| Modifier and Type | Method and Description |
|---|---|
static String |
format(Object... templateAndArguments)
Format the message from Object array
|
static String |
format(String messageTemplate,
Object... arguments)
Format the message, see the next correct asserts:
assertEquals("TEST" , MsgFormatter.format("TE{}T", "S"));
assertEquals("TE, S, T", MsgFormatter.format("TE", "S", "T"));
assertEquals("TES{}" , MsgFormatter.format("TE{}{}", "S"));
|
protected static final String MARK
protected static final String SEPARATOR
@Nonnull public static String format(@Nullable String messageTemplate, @Nullable Object... arguments)
assertEquals("TEST" , MsgFormatter.format("TE{}T", "S"));
assertEquals("TE, S, T", MsgFormatter.format("TE", "S", "T"));
assertEquals("TES{}" , MsgFormatter.format("TE{}{}", "S"));
messageTemplate - Template where argument position is marked by the {} characters.arguments - Optional arguments@Nullable public static String format(@Nullable Object... templateAndArguments)
templateAndArguments - The first item is a template where parameters are located by "{}"
text and the next arguments are optional parameters of the template.null.Copyright 2015, Pavel Ponec