@ThreadSafe public final class Message extends AbstractMessage
Messages class.
Note: the formatting is done only when at least one parameter is supplied; otherwise, the string is returned unmodified (single quotes do not have to be doubled and curly braces are ordinary characters).
| Constructor and Description |
|---|
Message(Messages.Entry entry,
Object... params)
Constructs an instance.
|
Message(String format,
Object... params)
Constructs an instance.
|
Message(Throwable cause,
Messages.Entry entry,
Object... params)
Constructs an instance.
|
Message(Throwable cause,
String format,
Object... params)
Constructs an instance.
|
| Modifier and Type | Method and Description |
|---|---|
static String |
format(Messages.Entry entry,
Object... params)
Formats a message.
|
String |
format(Object... params)
Formats this.
|
static String |
format(String format,
Object... params)
Formats a message.
|
Optional<Throwable> |
getCause()
Gets the cause of this message.
|
Optional<Messages.Entry> |
getEntry()
Gets the entry.
|
Object[] |
getParams()
Gets the params.
|
static String |
mark(String format,
Object... params)
Marks a message format for conversion to resource.
|
String |
toString() |
getFormat, getFormattedMessage, getParameters, getThrowable, saveFormattedpublic Message(@Nonnull
Messages.Entry entry,
@Nonnull
Object... params)
entry - The messages entry.params - The message parameters.public Message(@Nonnull
String format,
@Nonnull
Object... params)
format - The message format.params - The message parameters.public Message(@Nonnull
Throwable cause,
@Nonnull
Messages.Entry entry,
@Nonnull
Object... params)
cause - The message cause.entry - The messages entry.params - The message parameters.public Message(@Nonnull
Throwable cause,
@Nonnull
String format,
@Nonnull
Object... params)
cause - The message cause.format - The message format.params - The message parameters.@Nonnull
@CheckReturnValue
public static String format(@Nonnull
Messages.Entry entry,
@Nonnull
Object... params)
entry - The messages entry.params - The message parameters.@Nonnull
@CheckReturnValue
public static String format(@Nonnull
String format,
@Nonnull
Object... params)
format - The message format.params - The message parameters.@Nonnull
@CheckReturnValue
public static String mark(@Nonnull
String format,
@Nonnull
Object... params)
The message formats needing conversion can be found by performing a search for all calls to this method.
format - The message format.params - The message parameters.@Nonnull
@CheckReturnValue
public String format(@Nonnull
Object... params)
params - The message parameters.@Nonnull @CheckReturnValue public Optional<Throwable> getCause()
@Nonnull @CheckReturnValue public Optional<Messages.Entry> getEntry()
@Nonnull @CheckReturnValue public Object[] getParams()
public String toString()
toString in class ObjectCopyright © 2003-2019 Serge Brisson. All Rights Reserved.