Class PrintableMap<K,V>

  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap<K,V>
          extended by java.util.LinkedHashMap<K,V>
              extended by org.tinyjee.maven.dim.utils.PrintableMap<K,V>
All Implemented Interfaces:
Serializable, Cloneable, Map<K,V>

public class PrintableMap<K,V>
extends LinkedHashMap<K,V>

Extends LinkedHashMap with the ability to print the map's contents as formatted string.

Contents are automatically printed to the build log when a non-existing key is queried or when printContent() is called.

Juergen_Kellerer, 2011-09-30
See Also:
Serialized Form

Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor Summary
PrintableMap(Map<? extends K,? extends V> map, String name)
PrintableMap(String name)
Method Summary
 V get(Object key)
 String getContentAsString()
 void printContent()
Methods inherited from class java.util.LinkedHashMap
clear, containsValue, removeEldestEntry
Methods inherited from class java.util.HashMap
clone, containsKey, entrySet, isEmpty, keySet, put, putAll, remove, size, values
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
containsKey, entrySet, equals, hashCode, isEmpty, keySet, put, putAll, remove, size, values

Constructor Detail


public PrintableMap(String name)


public PrintableMap(Map<? extends K,? extends V> map,
                    String name)
Method Detail


public V get(Object key)
Specified by:
get in interface Map<K,V>
get in class LinkedHashMap<K,V>


public void printContent()


public String getContentAsString()