Package org.smartparam.engine.util
Class Printer
java.lang.Object
org.smartparam.engine.util.Printer
The util class for formatting collection or array contents.
- Since:
- 1.0.0
- Author:
- Przemek Hertel
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringPrints content of given array without restrictions of line number.static Stringprint(Collection<?> list, String title) Print contents of given collection without limiting the number of lines.static Stringprint(Collection<?> list, String title, int maxLines, Formatter formatter) Creates a string representing the contents of thelistcollection in readable form.
-
Method Details
-
print
Creates a string representing the contents of thelistcollection in readable form. Each element of the collection is listed on the next line. The user can specify the maximum number of lines that will be printed. Additionally, you can enterformatterwhich will be used for formatting every item in the collection. There is a limit of minimal number of lines from the bottom formaxNumberparameter - at least 3 lines.- Parameters:
list- collection of objectstitle- optional title of collectionmaxLines- maximum number of lines to be printed, or 0 if there are no restrictionsformatter- object formatting each element in the collection- Returns:
- a collection representation in which each element is presented on a separate line
-
print
Print contents of given collection without limiting the number of lines.- Parameters:
list- collection of objectstitle- optional title of collection- Returns:
- string representation of table content in which each element is presented on a separate line
- See Also:
-
print
Prints content of given array without restrictions of line number.- Parameters:
array- array of objectstitle- optional title- Returns:
- string representation of table content in which each element is presented on a separate line
- See Also:
-