Class InsightBuilder


  • public final class InsightBuilder
    extends java.lang.Object
    Builds a concise and readable string that gives insight of the concerned part of the system. The resulted string is made up of a list of short strings, each of which gives out a piece of information.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.ArrayList<java.lang.String> buffer  
    • Constructor Summary

      Constructors 
      Constructor Description
      InsightBuilder()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      InsightBuilder append​(java.lang.Object insight)
      Appends a piece of information which is a plain string.
      InsightBuilder appendKeyValue​(java.lang.String key, java.lang.Object value)
      Appends a piece of information which is a key-value , which will be formatted into "key=value".
      java.lang.String toString()
      Get the resulting string.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • buffer

        private final java.util.ArrayList<java.lang.String> buffer
    • Constructor Detail

      • InsightBuilder

        public InsightBuilder()
    • Method Detail

      • append

        public InsightBuilder append​(@Nullable
                                     java.lang.Object insight)
        Appends a piece of information which is a plain string. The given object is immediately converted to string and recorded.
      • appendKeyValue

        public InsightBuilder appendKeyValue​(java.lang.String key,
                                             @Nullable
                                             java.lang.Object value)
        Appends a piece of information which is a key-value , which will be formatted into "key=value". Value's toString() or null is immediately recorded.
      • toString

        public java.lang.String toString()
        Get the resulting string.
        Overrides:
        toString in class java.lang.Object