Package org.refcodes.mixin
Interface Dumpable
-
public interface DumpableDumps 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 aMapwhich 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 providedMapwhich 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 aMapwhich 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 newMapand callstoDump(Map). So you most probably implement thetoDump(Map)method.- Returns:
- The
Mapwith 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 providedMapwhich 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.Mapproperties are processed but not recursively digged into. Existing properties are overwritten in case shadowing super-class's properties.- Parameters:
aDump- theMapwhere to dump to.- Returns:
- The
Mapwith the dumped properties of the implementing instance.
-
-