Class AbstractTextBuilder<T extends AbstractTextBuilder>

    • Field Detail

      • textAdded

        private boolean textAdded
      • builder

        private java.lang.StringBuilder builder
    • Constructor Detail

      • AbstractTextBuilder

        public AbstractTextBuilder()
    • Method Detail

      • isTextAdded

        public boolean isTextAdded()
        Specified by:
        isTextAdded in interface TextBuilder<T extends AbstractTextBuilder>
        Returns:
        true if at least one text fragment was added (even if fragment is empty)
      • append

        public T append​(java.lang.CharSequence text)
        Description copied from interface: TextBuilder
        Append given text
        Specified by:
        append in interface TextBuilder<T extends AbstractTextBuilder>
        Parameters:
        text - text to append
        Returns:
        this builder
      • prepend

        public T prepend​(java.lang.CharSequence text)
        Description copied from interface: TextBuilder
        Add given text to the beginning.
        Specified by:
        prepend in interface TextBuilder<T extends AbstractTextBuilder>
        Parameters:
        text - text to append
        Returns:
        this builder
      • appendColor

        protected java.lang.String appendColor​(java.lang.String text)
      • prependColor

        protected java.lang.String prependColor​(java.lang.String text)
      • setText

        public void setText​(java.lang.CharSequence text)
        Description copied from interface: TextBuilder
        Replace current text with the given one
        Specified by:
        setText in interface TextBuilder<T extends AbstractTextBuilder>
        Parameters:
        text - text
      • toString

        public java.lang.String toString()
        Specified by:
        toString in interface TextBuilder<T extends AbstractTextBuilder>
        Overrides:
        toString in class java.lang.Object
        Returns:
        result string
      • appendToText

        protected final void appendToText​(java.lang.String text)
      • prependToText

        protected final void prependToText​(java.lang.String text)
      • textLength

        protected final int textLength()
      • replaceText

        protected final void replaceText​(java.lang.String text)
      • toAppendableText

        protected java.lang.String toAppendableText​(java.lang.String text)