Package org.hamcrest
Class BaseDescription
java.lang.Object
org.hamcrest.BaseDescription
- All Implemented Interfaces:
Description
- Direct Known Subclasses:
StringDescription
A
Description that is stored as a string.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.hamcrest.Description
Description.NullDescription -
Field Summary
Fields inherited from interface org.hamcrest.Description
NONE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidappend(char c) Append the char c to the description.protected voidAppend the String str to the description.Appends the description of aSelfDescribingvalue to this description.appendList(String start, String separator, String end, Iterable<? extends SelfDescribing> values) Appends a list ofSelfDescribingobjects to the description.appendText(String text) Appends some plain text to the description.appendValue(Object value) Appends an arbitrary value to the description.<T> DescriptionappendValueList(String start, String separator, String end, Iterable<T> values) Appends a list of values to the description.final <T> DescriptionappendValueList(String start, String separator, String end, T... values) Appends a list of values to the description.
-
Constructor Details
-
BaseDescription
public BaseDescription()Default constructor
-
-
Method Details
-
appendText
Description copied from interface:DescriptionAppends some plain text to the description.- Specified by:
appendTextin interfaceDescription- Parameters:
text- the text to append.- Returns:
- the update description when displaying the matcher error.
-
appendDescriptionOf
Description copied from interface:DescriptionAppends the description of aSelfDescribingvalue to this description.- Specified by:
appendDescriptionOfin interfaceDescription- Parameters:
value- the value to append.- Returns:
- the update description when displaying the matcher error.
-
appendValue
Description copied from interface:DescriptionAppends an arbitrary value to the description.- Specified by:
appendValuein interfaceDescription- Parameters:
value- the object to append.- Returns:
- the update description when displaying the matcher error.
-
appendValueList
@SafeVarargs public final <T> Description appendValueList(String start, String separator, String end, T... values) Description copied from interface:DescriptionAppends a list of values to the description.- Specified by:
appendValueListin interfaceDescription- Type Parameters:
T- the description type.- Parameters:
start- the prefix.separator- the separator.end- the suffix.values- the values to append.- Returns:
- the update description when displaying the matcher error.
-
appendValueList
public <T> Description appendValueList(String start, String separator, String end, Iterable<T> values) Description copied from interface:DescriptionAppends a list of values to the description.- Specified by:
appendValueListin interfaceDescription- Type Parameters:
T- the description type.- Parameters:
start- the prefix.separator- the separator.end- the suffix.values- the values to append.- Returns:
- the update description when displaying the matcher error.
-
appendList
public Description appendList(String start, String separator, String end, Iterable<? extends SelfDescribing> values) Description copied from interface:DescriptionAppends a list ofSelfDescribingobjects to the description.- Specified by:
appendListin interfaceDescription- Parameters:
start- the prefix.separator- the separator.end- the suffix.values- the values to append.- Returns:
- the update description when displaying the matcher error.
-
append
Append the String str to the description. The default implementation passes every character toappend(char). Override in subclasses to provide an efficient implementation.- Parameters:
str- the string to append.
-
append
protected abstract void append(char c) Append the char c to the description.- Parameters:
c- the char to append.
-