Package 

Interface IndentedStringable

  • All Implemented Interfaces:

    
    public interface IndentedStringable
    
                        

    If your class makes a data structure, then indented output showing any tree structures will greatly ease debugging. Be careful about circular references (A writes out B which writes out A). In a tree, a child node should print out the parentId instead of the full dump of the parent (which would include the child and loop infinitely).

    Use the the methods in StringUtils to implement this and pretty-print Indented data structures for joyful debugging.

    You'll typically then want to implement .toString() by calling indentedStr(0). If your class's reason for existence is to generate a string, you should probably use that string for debugging instead of implementing this interface.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract String indentedStr(Integer indent) Like toString() but indented to show the structure of your data.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • indentedStr

         abstract String indentedStr(Integer indent)

        Like toString() but indented to show the structure of your data.