public class WritableAssertionInfo extends java.lang.Object implements AssertionInfo
Modifier and Type | Field and Description |
---|---|
private Description |
description |
private static java.lang.String |
EMPTY_STRING |
private java.lang.String |
overridingErrorMessage |
private Representation |
representation |
Constructor and Description |
---|
WritableAssertionInfo() |
WritableAssertionInfo(Representation customRepresentation) |
Modifier and Type | Method and Description |
---|---|
Description |
description()
Returns the description of an assertion.
|
void |
description(Description newDescription)
Sets the description of an assertion, if given null an empty
Description is set. |
void |
description(java.lang.String newDescription,
java.lang.Object... args)
Sets the description of an assertion, if given null an empty
Description is set. |
java.lang.String |
descriptionText()
Returns the text of this object's description, it is an empty String if no description was set.
|
boolean |
hasDescription()
Returns whether the text of this object's description was set.
|
static java.lang.String |
mostRelevantDescriptionIn(WritableAssertionInfo info,
java.lang.String newDescription) |
java.lang.String |
overridingErrorMessage()
Returns the message that, if specified, will replace the default message of an assertion failure.
|
void |
overridingErrorMessage(java.lang.String newErrorMessage)
Sets the message that will replace the default message of an assertion failure.
|
Representation |
representation() |
java.lang.String |
toString() |
void |
useBinaryRepresentation() |
void |
useHexadecimalRepresentation() |
void |
useRepresentation(Representation newRepresentation) |
void |
useUnicodeRepresentation() |
private static final java.lang.String EMPTY_STRING
private java.lang.String overridingErrorMessage
private Description description
private Representation representation
public WritableAssertionInfo(Representation customRepresentation)
public WritableAssertionInfo()
public java.lang.String overridingErrorMessage()
overridingErrorMessage
in interface AssertionInfo
public void overridingErrorMessage(java.lang.String newErrorMessage)
newErrorMessage
- the new message. It can be null
.public Description description()
description
in interface AssertionInfo
public java.lang.String descriptionText()
public boolean hasDescription()
public void description(java.lang.String newDescription, java.lang.Object... args)
Description
is set.newDescription
- the new description.args
- if newDescription
is a format String, args
is argument of String.format(String, Object...)
description(Description)
public void description(Description newDescription)
Description
is set.
To remove or clear the description, pass a
as
argument.EmptyTextDescription
newDescription
- the new description.public Representation representation()
representation
in interface AssertionInfo
public void useHexadecimalRepresentation()
public void useUnicodeRepresentation()
public void useBinaryRepresentation()
public void useRepresentation(Representation newRepresentation)
public static java.lang.String mostRelevantDescriptionIn(WritableAssertionInfo info, java.lang.String newDescription)
public java.lang.String toString()
toString
in class java.lang.Object