summaryrefslogtreecommitdiffstats
path: root/hamcrest-core/src/org/hamcrest/Description.java
blob: 36ddedac050643f574d209be98c438c6f24e6a4e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package org.hamcrest;

/**
 * A description of a Matcher. A Matcher will describe itself to a description
 * which can later be used for reporting.
 *
 * @see Matcher#describeTo(Description)
 */
public interface Description {

    /**
     * Appends some plain text to the description.
     */
    Description appendText(String text);
    
    /**
     * Appends the description of a {@link SelfDescribing} value to this description.
     */
    Description appendDescriptionOf(SelfDescribing value);
    
    /**
     * Appends an arbitary value to the description.
     */
    Description appendValue(Object value);
    
    /**
     * Appends a list of values to the description.
     */
    <T> Description appendValueList(String start, String separator, String end,
    							    T... values);

    /**
     * Appends a list of values to the description.
     */
    <T> Description appendValueList(String start, String separator, String end,
    							    Iterable<T> values);
    
    /** 
     * Appends a list of {@link org.hamcrest.SelfDescribing} objects
     * to the description. 
     */
    Description appendList(String start, String separator, String end, 
                           Iterable<? extends SelfDescribing> values);
}