Package edu.wisc.ssec.mcidasv.util
Class MakeToString
java.lang.Object
edu.wisc.ssec.mcidasv.util.MakeToString
Utility class for
toString()
methods.
Largely taken from Guava's toStringHelper()
, with some
formatting differences as well as the hash code for the given instance.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final String
private final MakeToString.ValueHolder
private final int
private boolean
private MakeToString.ValueHolder
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
MakeToString
(Object instance) private
MakeToString
(String clazzName) -
Method Summary
Modifier and TypeMethodDescriptionprivate MakeToString.ValueHolder
private MakeToString
static MakeToString
static MakeToString
fromInstance
(Object instance) toString()
After calling this method, you can keep adding more properties to later call toString() again and get a more complete representation of the same object; but properties cannot be removed, so this only allows limited reuse of the helper instance.
-
Field Details
-
head
-
className
-
instanceHashCode
-
omitNullValues
-
tail
-
-
Constructor Details
-
MakeToString
-
MakeToString
-
-
Method Details
-
fromInstance
-
fromClass
-
omitNullValues
-
addQuoted
-
add
-
add
-
add
-
add
-
add
-
add
-
add
-
add
-
addHolder
-
addHolder
-
toString
After calling this method, you can keep adding more properties to later call toString() again and get a more complete representation of the same object; but properties cannot be removed, so this only allows limited reuse of the helper instance. The helper allows duplication of properties (multiple name/value pairs with the same name can be added).
-