Package org.refcodes.mixin
Interface Dumpable
-
public interface Dumpable
Dumps the state of the instance into aMap
. Each property representing the implementing class's state should be dumped into a separate key/value pair of theMap
. The default implementation of this interface applies basic reflection mechanisms to create a dump of the implementing instance's state.
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default java.util.Map<java.lang.String,java.lang.String>
toDump()
Dumps the state of the implementing instance into aMap
which is returned as result.default java.util.Map<java.lang.String,java.lang.String>
toDump(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.
-
-
-
Method Detail
-
toDump
default java.util.Map<java.lang.String,java.lang.String> toDump()
Dumps the state of the implementing instance into aMap
which is returned as result. ThetoDump()
method may call thetoDump(Map)
methods of internal instances also being part of the state. The default implementation creates a newMap
and callstoDump(Map)
. So you most probably implement thetoDump(Map)
method.- Returns:
- The
Map
with the dumped properties of the implementing instance.
-
toDump
default java.util.Map<java.lang.String,java.lang.String> toDump(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. ThetoDump(Map)
method may call thetoDump(Map)
methods of internal instances also being part of the state. You most probably implement thetoDump(Map)
method as thetoDump()
method has a default implementation invokingtoDump(Map)
with an emptyMap
. 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:
aDump
- theMap
where to dump to.- Returns:
- The
Map
with the dumped properties of the implementing instance.
-
-