Interface Dumpable

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Interface Description
      static interface  Dumpable.DumpableContainer
      DumpableContainer A Dumpable that is a container of beans can implement this interface to allow it to refine which of its beans can be dumped.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String KEY  
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default java.lang.String dump()  
      void dump​(java.lang.Appendable out, java.lang.String indent)
      Dump this object (and children) into an Appendable using the provided indent after any new lines.
      static java.lang.String dump​(Dumpable dumpable)
      Utility method to implement dump() by calling dump(Appendable, String)
      static void dumpContainer​(java.lang.Appendable out, java.lang.String indent, Container object, boolean last)  
      static void dumpIterable​(java.lang.Appendable out, java.lang.String indent, java.lang.Iterable<?> iterable, boolean last)  
      static void dumpMapEntries​(java.lang.Appendable out, java.lang.String indent, java.util.Map<?,​?> map, boolean last)  
      static void dumpObject​(java.lang.Appendable out, java.lang.Object o)
      Dump just an Object (but not it's contained items) to an Appendable.
      static void dumpObjects​(java.lang.Appendable out, java.lang.String indent, java.lang.Object object, java.lang.Object... extraChildren)
      Dump an Object, it's contained items and additional items to an Appendable.
      default java.lang.String dumpSelf()
      The description of this/self found in the dump.
      static Dumpable named​(java.lang.String name, java.lang.Object object)  
    • Method Detail

      • dump

        void dump​(java.lang.Appendable out,
                  java.lang.String indent)
           throws java.io.IOException
        Dump this object (and children) into an Appendable using the provided indent after any new lines. The indent should not be applied to the first object dumped.
        Parameters:
        out - The appendable to dump to
        indent - The indent to apply after any new lines.
        Throws:
        java.io.IOException - if unable to write to Appendable
      • dump

        static java.lang.String dump​(Dumpable dumpable)
        Utility method to implement dump() by calling dump(Appendable, String)
        Parameters:
        dumpable - The dumpable to dump
        Returns:
        The dumped string
      • dumpSelf

        default java.lang.String dumpSelf()
        The description of this/self found in the dump. Allows for alternative representation of Object other then .toString() where the long form output of toString() is represented in a cleaner way within the dump infrastructure.
        Returns:
        the representation of self
      • dumpObject

        static void dumpObject​(java.lang.Appendable out,
                               java.lang.Object o)
                        throws java.io.IOException
        Dump just an Object (but not it's contained items) to an Appendable.
        Parameters:
        out - The Appendable to dump to
        o - The object to dump.
        Throws:
        java.io.IOException - May be thrown by the Appendable
      • dumpObjects

        static void dumpObjects​(java.lang.Appendable out,
                                java.lang.String indent,
                                java.lang.Object object,
                                java.lang.Object... extraChildren)
                         throws java.io.IOException
        Dump an Object, it's contained items and additional items to an Appendable. If the object in an Iterable or an Array, then its contained items are also dumped.
        Parameters:
        out - the Appendable to dump to
        indent - The indent to apply after any new lines
        object - The object to dump. If the object is an instance of Container, Stream, Iterable, Array or Map, then children of the object a recursively dumped.
        extraChildren - Items to be dumped as children of the object, in addition to any discovered children of object
        Throws:
        java.io.IOException - May be thrown by the Appendable
      • dumpContainer

        static void dumpContainer​(java.lang.Appendable out,
                                  java.lang.String indent,
                                  Container object,
                                  boolean last)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • dumpIterable

        static void dumpIterable​(java.lang.Appendable out,
                                 java.lang.String indent,
                                 java.lang.Iterable<?> iterable,
                                 boolean last)
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • dumpMapEntries

        static void dumpMapEntries​(java.lang.Appendable out,
                                   java.lang.String indent,
                                   java.util.Map<?,​?> map,
                                   boolean last)
                            throws java.io.IOException
        Throws:
        java.io.IOException
      • named

        static Dumpable named​(java.lang.String name,
                              java.lang.Object object)