Top Description Fields Constructors Methods
org.hamcrest

public Class StringDescription

extends BaseDescription
Class Inheritance
Imports
java.io.IOException

A Description that is stored as a string.

Field Summary

Modifier and TypeField and Description
private final Appendable

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
protected void
append(String str)

Overrides org.hamcrest.BaseDescription.append.

Append the String str to the description.
protected void
append(char c)

Implements abstract org.hamcrest.BaseDescription.append.

Append the char c to the description.
public static String
public static String

Returns:

The description of the object.
toString
(SelfDescribing
The object to be described.
selfDescribing
)

Return the description of a SelfDescribing object as a String.

public String
toString()

Overrides java.lang.Object.toString.

Returns the description as a string.
Inherited from org.hamcrest.BaseDescription:
appendDescriptionOfappendListappendTextappendValueappendValueListappendValueList

Field Detail

outback to summary
private final Appendable out

Constructor Detail

StringDescriptionback to summary
public StringDescription()
StringDescriptionback to summary
public StringDescription(Appendable out)

Method Detail

appendback to summary
protected void append(String str)

Overrides org.hamcrest.BaseDescription.append.

Doc from org.hamcrest.BaseDescription.append.

Append the String str to the description. The default implementation passes every character to append(char). Override in subclasses to provide an efficient implementation.

Annotations
@Override
appendback to summary
protected void append(char c)

Implements abstract org.hamcrest.BaseDescription.append.

Doc from org.hamcrest.BaseDescription.append.

Append the char c to the description.

Annotations
@Override
asStringback to summary
public static String asString(SelfDescribing selfDescribing)

Alias for toString(SelfDescribing).

toStringback to summary
public static String toString(SelfDescribing selfDescribing)

Return the description of a SelfDescribing object as a String.

Parameters
selfDescribing:SelfDescribing

The object to be described.

Returns:String

The description of the object.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns the description as a string.

Returns:String

Doc from java.lang.Object.toString.

a string representation of the object

Annotations
@Override