Class RawTextBuilder<T extends RawTextBuilder>

  • All Implemented Interfaces:
    TextBuilder<T>

    @OpenApiAll
    public class RawTextBuilder<T extends RawTextBuilder>
    extends java.lang.Object
    implements TextBuilder<T>
    Builds a text without any transformation - input text is appended to the output text. Builder does not support colored fragments directly - result text does not have colors. However colors are be supported if appendTo(TextBuilder) is used and proper builder is passed.
    • Constructor Detail

      • RawTextBuilder

        public RawTextBuilder()
    • Method Detail

      • append

        public T append​(java.lang.CharSequence text)
        Description copied from interface: TextBuilder
        Append given text
        Specified by:
        append in interface TextBuilder<T extends RawTextBuilder>
        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 RawTextBuilder>
        Parameters:
        text - text to append
        Returns:
        this builder
      • toString

        public java.lang.String toString()
        Specified by:
        toString in interface TextBuilder<T extends RawTextBuilder>
        Overrides:
        toString in class java.lang.Object
        Returns:
        result string
      • 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 RawTextBuilder>
        Parameters:
        text - text
      • setColor

        public T setColor​(@CheckForNull
                          java.awt.Color color)
        Description copied from interface: TextBuilder
        Set color of the text which will be added later. Not every implementation supports that, so color can be ignored.
        Specified by:
        setColor in interface TextBuilder<T extends RawTextBuilder>
        Parameters:
        color - color to set. Null is used to reset previously set color
        Returns:
        this builder
      • appendTo

        public void appendTo​(TextBuilder builder)
        Appends text from this builder to the given one.
        Parameters:
        builder - given builder
      • isTextAdded

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