Package ubic.basecode.util
Class PrettyPrinter
java.lang.Object
ubic.basecode.util.PrettyPrinter
Very simple class to produce String versions of beans and other objects.
For beans, the entire hierarchy of associations for each object is printed in a tree-like format. This is primarily used for testing.
- Author:
- pavlidis
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
print
(Collection<String> packages, Object object) Pretty-print a single bean.static String
print
(Collection<String> packages, Object[] objects) Print out a collection of objects in a relatively pleasing format.static String
print
(Collection<String> packages, Collection<Object> beans) Print out a collection of beans in a relatively pleasing format.
-
Method Details
-
print
Print out a collection of beans in a relatively pleasing format.- Parameters:
packages
- collection of Strings for inclusion of classes for printing. E.g. "ubic.gemma" would print all classes in the ubic.gemma package (including subpackages). If empty, everything gets printed.beans
- Collection of beans.- Returns:
- String representing the objects.
-
print
Pretty-print a single bean. Beans that are not part of this project are ignored.- Parameters:
packages
- collection of Strings for inclusion of classes for printing. E.g. "ubic.gemma" would print all classes in the ubic.gemma package (including subpackages). If empty, everything gets printed.object
-- Returns:
- String representing the object.
-
print
Print out a collection of objects in a relatively pleasing format.- Parameters:
packages
- collection of Strings for inclusion of classes for printing. E.g. "ubic.gemma" would print all classes in the ubic.gemma package (including subpackages). If empty, everything gets printed.beans
- Collection of beans.- Returns:
- String representing the objects.
-