public final class Messages
extends java.lang.Object
Message objects| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
bold(java.lang.String text) |
static Message |
create(ErrorId errorId,
java.lang.String messageFormat,
java.lang.Object... arguments)
Creates a new Message without a cause.
|
static Message |
create(ErrorId errorId,
java.lang.Throwable cause,
java.util.List<java.lang.Object> sources,
java.lang.String messageFormat,
java.lang.Object... arguments)
Creates a new Message with the given cause and a binding source stack.
|
static Message |
create(ErrorId errorId,
java.lang.Throwable cause,
java.lang.String messageFormat,
java.lang.Object... arguments)
Creates a new Message with the given cause.
|
static java.lang.String |
faint(java.lang.String text) |
static java.lang.String |
format(java.lang.String messageFormat,
java.lang.Object... arguments)
Calls
String.format(java.lang.String, java.lang.Object...) after converting the arguments using some standard guice formatting
for Key, Class and Member objects. |
static java.lang.String |
formatMessages(java.lang.String heading,
java.util.Collection<Message> errorMessages)
Returns the formatted message for an exception with the specified messages.
|
static java.lang.Throwable |
getOnlyCause(java.util.Collection<Message> messages)
Returns the cause throwable if there is exactly one cause in
messages. |
static java.lang.String |
redBold(java.lang.String text) |
static java.lang.String |
underline(java.lang.String text) |
public static java.lang.String format(java.lang.String messageFormat,
java.lang.Object... arguments)
String.format(java.lang.String, java.lang.Object...) after converting the arguments using some standard guice formatting
for Key, Class and Member objects.public static java.lang.String formatMessages(java.lang.String heading,
java.util.Collection<Message> errorMessages)
public static Message create(ErrorId errorId, java.lang.String messageFormat, java.lang.Object... arguments)
errorId - The enum id for the errormessageFormat - Format stringarguments - format string argumentspublic static Message create(ErrorId errorId, java.lang.Throwable cause, java.lang.String messageFormat, java.lang.Object... arguments)
errorId - The enum id for the errorcause - The exception that caused the errormessageFormat - Format stringarguments - format string argumentspublic static Message create(ErrorId errorId, java.lang.Throwable cause, java.util.List<java.lang.Object> sources, java.lang.String messageFormat, java.lang.Object... arguments)
errorId - The enum id for the errorcause - The exception that caused the errorsources - The binding sources for the source stackmessageFormat - Format stringarguments - format string argumentspublic static java.lang.Throwable getOnlyCause(java.util.Collection<Message> messages)
messages. If there are
zero or multiple messages with causes, null is returned.public static final java.lang.String bold(java.lang.String text)
public static final java.lang.String redBold(java.lang.String text)
public static final java.lang.String underline(java.lang.String text)
public static final java.lang.String faint(java.lang.String text)