Class ValuePrinter
- java.lang.Object
-
- org.mockito.internal.matchers.text.ValuePrinter
-
public class ValuePrinter extends java.lang.ObjectPrints a Java object value in a way humans can read it neatly. Inspired on hamcrest. Used for printing arguments in verification errors.
-
-
Constructor Summary
Constructors Modifier Constructor Description privateValuePrinter()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static java.lang.StringdescriptionOf(java.lang.Object value)static java.lang.Stringprint(java.lang.Object value)Prints given value so that it is neatly readable by humans.private static java.lang.StringprintChar(char value)private static java.lang.StringprintMap(java.util.Map<?,?> map)static java.lang.StringprintValues(java.lang.String start, java.lang.String separator, java.lang.String end, java.util.Iterator<?> values)Print values in a nice format, e.g.
-
-
-
Method Detail
-
print
public static java.lang.String print(java.lang.Object value)
Prints given value so that it is neatly readable by humans. Handles explosive toString() implementations.
-
printMap
private static java.lang.String printMap(java.util.Map<?,?> map)
-
printValues
public static java.lang.String printValues(java.lang.String start, java.lang.String separator, java.lang.String end, java.util.Iterator<?> values)Print values in a nice format, e.g. (1, 2, 3)- Parameters:
start- the beginning of the values, e.g. "("separator- the separator of values, e.g. ", "end- the end of the values, e.g. ")"values- the values to print- Returns:
- neatly formatted value list
-
printChar
private static java.lang.String printChar(char value)
-
descriptionOf
private static java.lang.String descriptionOf(java.lang.Object value)
-
-