Interface Dumpable


public interface Dumpable
Dumps the state of the instance into a Map. Each property representing the implementing class's state should be dumped into a separate key/value pair of the Map. The default implementation of this interface applies basic reflection mechanisms to create a dump of the implementing instance's state.
  • Method Summary

    Modifier and Type Method Description
    default Map<String,​String> toDump()
    Dumps the state of the implementing instance into a Map which is returned as result.
    default Map<String,​String> toDump​(Map<String,​String> aDump)
    Dumps the state of the implementing instance into the provided Map which is returned as result.
    default String toPrintable()
    Creates a printable representation of the content of this map.
  • Method Details

    • toDump

      default Map<String,​String> toDump()
      Dumps the state of the implementing instance into a Map which is returned as result. The toDump() method may call the toDump(Map) methods of internal instances also being part of the state. The default implementation creates a new Map and calls toDump(Map). So you most probably implement the toDump(Map) method.
      Returns:
      The Map with the dumped properties of the implementing instance.
    • toDump

      default Map<String,​String> toDump​(Map<String,​String> aDump)
      Dumps the state of the implementing instance into the provided Map which is returned as result. The toDump(Map) method may call the toDump(Map) methods of internal instances also being part of the state. You most probably implement the toDump(Map) method as the toDump() method has a default implementation invoking toDump(Map) with an empty Map. 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 - the Map where to dump to.
      Returns:
      The Map with the dumped properties of the implementing instance.
    • toPrintable

      default String toPrintable()
      Creates a printable representation of the content of this map.
      Returns:
      A String with the content of this map which directly can be printed.