public class WritableAssertionInfo extends Object implements AssertionInfo
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(String newDescription,
Object... args)
Sets the description of an assertion, if given null an empty
Description is set. |
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 String |
mostRelevantDescriptionIn(WritableAssertionInfo info,
String newDescription) |
String |
overridingErrorMessage()
Returns the message that, if specified, will replace the default message of an assertion failure.
|
void |
overridingErrorMessage(String newErrorMessage)
Sets the message that will replace the default message of an assertion failure.
|
Representation |
representation() |
String |
toString() |
void |
useBinaryRepresentation() |
void |
useHexadecimalRepresentation() |
void |
useRepresentation(Representation newRepresentation) |
void |
useUnicodeRepresentation() |
public WritableAssertionInfo(Representation customRepresentation)
public WritableAssertionInfo()
public String overridingErrorMessage()
overridingErrorMessage
in interface AssertionInfo
public void overridingErrorMessage(String newErrorMessage)
newErrorMessage
- the new message. It can be null
.public Description description()
description
in interface AssertionInfo
public String descriptionText()
public boolean hasDescription()
public void description(String newDescription, 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 String mostRelevantDescriptionIn(WritableAssertionInfo info, String newDescription)
Copyright © 2013–2018 AssertJ. All rights reserved.