java.lang.Object
org.refcodes.runtime.DumpBuilder
- All Implemented Interfaces:
org.refcodes.mixin.ObjectAccessor,org.refcodes.mixin.ObjectAccessor.ObjectBuilder<DumpBuilder>,org.refcodes.mixin.ObjectAccessor.ObjectMutator,org.refcodes.mixin.ObjectAccessor.ObjectProperty
public class DumpBuilder
extends Object
implements org.refcodes.mixin.ObjectAccessor.ObjectProperty, org.refcodes.mixin.ObjectAccessor.ObjectBuilder<DumpBuilder>
The
DumpBuilder assists you in inspecting the content of an object.
Creates a Map containing the dump of an object's the member
variable's values, the names being the keys and the values being the member
variables' values.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.refcodes.mixin.ObjectAccessor
org.refcodes.mixin.ObjectAccessor.ObjectBuilder<B extends org.refcodes.mixin.ObjectAccessor.ObjectBuilder<B>>, org.refcodes.mixin.ObjectAccessor.ObjectMutator, org.refcodes.mixin.ObjectAccessor.ObjectProperty -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDumps the the provided object into aMapwhich is returned as result (the builder needs not to be instantiated).voidtoDump()Dumps the state of the contained object (as ofsetObject(Object)) into aMapwhich is returned as result.Dumps the state of the provided object into aMapwhich is returned as result.Dumps the state of the implementing instance into the providedMapwhich is returned as result.withObject(Object aObject) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.refcodes.mixin.ObjectAccessor.ObjectProperty
letObject
-
Constructor Details
-
DumpBuilder
public DumpBuilder()
-
-
Method Details
-
getObject
- Specified by:
getObjectin interfaceorg.refcodes.mixin.ObjectAccessor
-
setObject
- Specified by:
setObjectin interfaceorg.refcodes.mixin.ObjectAccessor.ObjectMutator
-
withObject
- Specified by:
withObjectin interfaceorg.refcodes.mixin.ObjectAccessor.ObjectBuilder<DumpBuilder>
-
toDump
Dumps the state of the provided object into aMapwhich is returned as result.- Parameters:
aObj- The object for which to create the dump.- Returns:
- The
Mapwith the dumped properties of the implementing instance.
-
toDump
Dumps the state of the contained object (as ofsetObject(Object)) into aMapwhich is returned as result.- Returns:
- The
Mapwith the dumped properties of the implementing instance.
-
asDump
Dumps the the provided object into aMapwhich is returned as result (the builder needs not to be instantiated).- Parameters:
aObj- The object for which to create the dump.- Returns:
- The
Mapwith the dumped properties of the implementing instance.
-
toDump
Dumps the state of the implementing instance into the providedMapwhich is returned as result. This default implementation uses reflection to create a basic dump.Mapproperties are processed but not recursively digged into. Existing properties are overwritten in case shadowing super-class's properties.
-