@Unmodifiable public class ValueFormatter extends MsgFormatter
{} 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 String |
valueBorder
Border of the byte array
|
DEFAULT_MARK, SEPARATOR| Modifier | Constructor and Description |
|---|---|
protected |
ValueFormatter()
Static methods are available only
|
protected |
ValueFormatter(@NotNull String mark,
@NotNull String textBorder)
Static methods are available only
|
| Modifier and Type | Method and Description |
|---|---|
static <T> @NotNull String |
format(@Nullable String messageTemplate,
T... 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"));
|
static <T> @NotNull String |
formatSql(@Nullable String sqlTemplate,
T... arguments)
Format the SQL where makup character is
'?'. |
protected int |
getSizeLimit()
Default lenhth is 32
|
protected void |
writeByteArray(@NotNull byte[] bytes,
@NotNull Appendable out)
Write bytes as hexa
|
protected void |
writeLongValue(@NotNull CharSequence value,
@NotNull Appendable out)
You can call the method from a child class
|
protected void |
writeValue(@Nullable Object value,
@NotNull Appendable out,
boolean marked)
Print argument to the Writter with an optional format.
|
format, format, formatMsg, formatMsgprotected final String valueBorder
protected void writeValue(@Nullable
@Nullable Object value,
@NotNull
@NotNull Appendable out,
boolean marked)
throws IOException
writeValue in class MsgFormatterout - Appendablevalue - A one value where the Supplier interface is supported.IOExceptionprotected void writeByteArray(@NotNull
@NotNull byte[] bytes,
@NotNull
@NotNull Appendable out)
throws IOException
IOExceptionprotected void writeLongValue(@NotNull
@NotNull CharSequence value,
@NotNull
@NotNull Appendable out)
throws IOException
IOExceptionprotected int getSizeLimit()
@NotNull public static <T> @NotNull String format(@Nullable @Nullable String messageTemplate, @Nullable T... 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@NotNull public static <T> @NotNull String formatSql(@Nullable @Nullable String sqlTemplate, @Nullable T... arguments)
'?'.
assertEquals("TEST" , MsgFormatter.format("TE?T", "S"));
assertEquals("TE, S, T", MsgFormatter.format("TE", "S", "T"));
assertEquals("TES{}" , MsgFormatter.format("TE??", "S"));
sqlTemplate - SQL template where argument position is marked by the '?' characters.arguments - Optional argumentsCopyright 2015, Pavel Ponec