Package org.hamcrest
Class StringDescription
- java.lang.Object
-
- org.hamcrest.BaseDescription
-
- org.hamcrest.StringDescription
-
- All Implemented Interfaces:
Description
public class StringDescription extends BaseDescription
ADescriptionthat is stored as a string.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.hamcrest.Description
Description.NullDescription
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Appendableout-
Fields inherited from interface org.hamcrest.Description
NONE
-
-
Constructor Summary
Constructors Constructor Description StringDescription()StringDescription(java.lang.Appendable out)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidappend(char c)Append the char c to the description.protected voidappend(java.lang.String str)Append the String str to the description.static java.lang.StringasString(SelfDescribing selfDescribing)Alias fortoString(SelfDescribing).java.lang.StringtoString()Returns the description as a string.static java.lang.StringtoString(SelfDescribing selfDescribing)Return the description of aSelfDescribingobject as a String.-
Methods inherited from class org.hamcrest.BaseDescription
appendDescriptionOf, appendList, appendText, appendValue, appendValueList, appendValueList
-
-
-
-
Method Detail
-
toString
public static java.lang.String toString(SelfDescribing selfDescribing)
Return the description of aSelfDescribingobject as a String.- Parameters:
selfDescribing- The object to be described.- Returns:
- The description of the object.
-
asString
public static java.lang.String asString(SelfDescribing selfDescribing)
Alias fortoString(SelfDescribing).
-
append
protected void append(java.lang.String str)
Description copied from class:BaseDescriptionAppend the String str to the description. The default implementation passes every character toBaseDescription.append(char). Override in subclasses to provide an efficient implementation.- Overrides:
appendin classBaseDescription
-
append
protected void append(char c)
Description copied from class:BaseDescriptionAppend the char c to the description.- Specified by:
appendin classBaseDescription
-
toString
public java.lang.String toString()
Returns the description as a string.- Overrides:
toStringin classjava.lang.Object
-
-