public class BasicErrorMessageFactory extends java.lang.Object implements ErrorMessageFactory
Modifier and Type | Class and Description |
---|---|
private static class |
BasicErrorMessageFactory.UnquotedString
To avoid quoted String in message format.
|
Modifier and Type | Field and Description |
---|---|
protected java.lang.Object[] |
arguments |
protected java.lang.String |
format |
(package private) MessageFormatter |
formatter |
Constructor and Description |
---|
BasicErrorMessageFactory(java.lang.String format,
java.lang.Object... arguments)
Creates a new
. |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
create()
Creates a new error message as a result of a failed assertion without description.
|
java.lang.String |
create(Description d)
Creates a new error message as a result of a failed assertion with
StandardRepresentation . |
java.lang.String |
create(Description d,
Representation representation)
Creates a new error message as a result of a failed assertion.
|
boolean |
equals(java.lang.Object obj) |
int |
hashCode() |
java.lang.String |
toString() |
protected static java.lang.CharSequence |
unquotedString(java.lang.String string)
Return a string who will be unquoted in message format (without '')
|
protected final java.lang.String format
protected final java.lang.Object[] arguments
MessageFormatter formatter
public BasicErrorMessageFactory(java.lang.String format, java.lang.Object... arguments)
BasicErrorMessageFactory
.format
- the format string.arguments
- arguments referenced by the format specifiers in the format string.public java.lang.String create(Description d, Representation representation)
create
in interface ErrorMessageFactory
d
- the description of the failed assertion.representation
- the representation usedpublic java.lang.String create(Description d)
StandardRepresentation
.create
in interface ErrorMessageFactory
d
- the description of the failed assertion.public java.lang.String create()
create
in interface ErrorMessageFactory
protected static java.lang.CharSequence unquotedString(java.lang.String string)
string
- the string who will be unquoted.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object