org.assertj.core.api
Class WritableAssertionInfo

java.lang.Object
  extended by org.assertj.core.api.WritableAssertionInfo
All Implemented Interfaces:
AssertionInfo

public class WritableAssertionInfo
extends Object
implements AssertionInfo

Writable information about an assertion.

Author:
Alex Ruiz, Yvonne Wang

Constructor Summary
WritableAssertionInfo()
           
 
Method Summary
 Description description()
          Returns the description of an assertion.
 void description(Description newDescription)
          Sets the description of an assertion.
 void description(String newDescription, Object... args)
          Sets the description of an assertion.
 String descriptionText()
          Returns the text of this object's description, or null if such description is null.
 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()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WritableAssertionInfo

public WritableAssertionInfo()
Method Detail

overridingErrorMessage

public String overridingErrorMessage()
Returns the message that, if specified, will replace the default message of an assertion failure.

Specified by:
overridingErrorMessage in interface AssertionInfo
Returns:
the message that, if specified, will replace the default message of an assertion failure.

overridingErrorMessage

public void overridingErrorMessage(String newErrorMessage)
Sets the message that will replace the default message of an assertion failure.

Parameters:
newErrorMessage - the new message. It can be null.

description

public Description description()
Returns the description of an assertion.

Specified by:
description in interface AssertionInfo
Returns:
the description of an assertion.

descriptionText

public String descriptionText()
Returns the text of this object's description, or null if such description is null.

Returns:
the text of this object's description, or null if such description is null.

description

public void description(String newDescription,
                        Object... args)
Sets the description of an assertion.

Parameters:
newDescription - the new description.
args - if newDescription is a format String, args is argument of String.format(String, Object...)
Throws:
NullPointerException - if the given description is null.
See Also:
description(Description)

description

public void description(Description newDescription)
Sets the description of an assertion. To remove or clear the description, pass a EmptyTextDescription as argument.

Parameters:
newDescription - the new description.
Throws:
NullPointerException - if the given description is null.

representation

public Representation representation()

Specified by:
representation in interface AssertionInfo

useHexadecimalRepresentation

public void useHexadecimalRepresentation()

useUnicodeRepresentation

public void useUnicodeRepresentation()

useBinaryRepresentation

public void useBinaryRepresentation()

useRepresentation

public void useRepresentation(Representation newRepresentation)

toString

public String toString()

Overrides:
toString in class Object


Copyright © 2013–2015 AssertJ. All rights reserved.