Package org.refcodes.runtime
Class DumpBuilderImpl
- java.lang.Object
-
- org.refcodes.runtime.DumpBuilderImpl
-
- All Implemented Interfaces:
org.refcodes.mixin.ObjectAccessor
,org.refcodes.mixin.ObjectAccessor.ObjectBuilder<DumpBuilder>
,org.refcodes.mixin.ObjectAccessor.ObjectMutator
,org.refcodes.mixin.ObjectAccessor.ObjectProperty
,DumpBuilder
public class DumpBuilderImpl extends java.lang.Object implements DumpBuilder
Extend thetoDump(Object, Map)
wit aList
if visited objects and a "nested"-counter and dig recursively into the object. Use theDelimiter.PATH
("/") delimiter to conform with theCanonicalMap
's Properties subclass (as of refcodes-configuration artifact).
-
-
Constructor Summary
Constructors Constructor Description DumpBuilderImpl()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
getObject()
void
setObject(java.lang.Object aObject)
java.util.Map<java.lang.String,java.lang.String>
toDump(java.lang.Object aObj)
Dumps the state of the provided object into aMap
which is returned as result.protected static java.util.Map<java.lang.String,java.lang.String>
toDump(java.lang.Object aObj, java.util.Map<java.lang.String,java.lang.String> aDump)
Dumps the state of the implementing instance into the providedMap
which is returned as result.DumpBuilder
withObject(java.lang.Object aObject)
-
Methods inherited from interface org.refcodes.runtime.DumpBuilder
toDump
-
-
-
-
Method Detail
-
getObject
public java.lang.Object getObject()
- Specified by:
getObject
in interfaceorg.refcodes.mixin.ObjectAccessor
-
setObject
public void setObject(java.lang.Object aObject)
- Specified by:
setObject
in interfaceorg.refcodes.mixin.ObjectAccessor.ObjectMutator
-
withObject
public DumpBuilder withObject(java.lang.Object aObject)
- Specified by:
withObject
in interfaceorg.refcodes.mixin.ObjectAccessor.ObjectBuilder<DumpBuilder>
-
toDump
public java.util.Map<java.lang.String,java.lang.String> toDump(java.lang.Object aObj)
Dumps the state of the provided object into aMap
which is returned as result.- Specified by:
toDump
in interfaceDumpBuilder
- Parameters:
aObj
- The object for which to create the dump.- Returns:
- The
Map
with the dumped properties of the implementing instance.
-
toDump
protected static java.util.Map<java.lang.String,java.lang.String> toDump(java.lang.Object aObj, java.util.Map<java.lang.String,java.lang.String> aDump)
Dumps the state of the implementing instance into the providedMap
which is returned as result. This default implementation uses reflection to create a basic dump.Map
properties are processed but not recursively digged into. Existing properties are overwritten in case shadowing super-class's properties.- Parameters:
aObj
- The object to be dumped.aDump
- theMap
where to dump to.- Returns:
- The
Map
with the dumped properties of the implementing instance.
-
-