Class ObjectUtility
java.lang.Object
org.glassfish.pfl.test.ObjectUtility
General object related utilities. This class must not depend on
generated log wrappers.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringcompactObjectToString(Object object) static ObjectconcatenateArrays(Object arr1, Object arr2) If arr1 and arr2 are both arrays of the same component type, return an array of that component type that consists of the elements of arr1 followed by the elements of arr2.static StringdefaultObjectToString(Object object) A convenience method that gives the default behavior: use indenting to display the object's structure and do not use built-in toString methods.static voidstatic booleanstatic voidstatic ObjectUtilitymake()Get the standard Utility object that supports objectToString with indented display and no use of toString() methods.static ObjectUtilitymake(boolean useToString, boolean isIndenting) Construct an Utility instance with the desired objectToString behavior.static ObjectUtilitymake(boolean useToString, boolean isIndenting, int initialLevel, int increment) Construct an Utility instance with the desired objectToString behavior.objectToString(Object obj) objectToString handles display of arbitrary objects.
-
Method Details
-
make
public static ObjectUtility make(boolean useToString, boolean isIndenting, int initialLevel, int increment) Construct an Utility instance with the desired objectToString behavior. -
make
Construct an Utility instance with the desired objectToString behavior. -
make
Get the standard Utility object that supports objectToString with indented display and no use of toString() methods. -
defaultObjectToString
-
compactObjectToString
-
objectToString
objectToString handles display of arbitrary objects. It correctly handles objects whose elements form an arbitrary graph. It uses reflection to display the contents of any kind of object. An object's toString() method may optionally be used, but the default is to ignore all toString() methods except for those defined for primitive types, primitive type wrappers, and strings. -
equals
-
concatenateArrays
-
displayException
-
main
-