Package com.nomagic.text.builders
Class PlainTextBuilder<T extends PlainTextBuilder>
- java.lang.Object
-
- com.nomagic.text.builders.AbstractTextBuilder<T>
-
- com.nomagic.text.builders.PlainTextBuilder<T>
-
- All Implemented Interfaces:
TextBuilder<T>
@OpenApiAll public class PlainTextBuilder<T extends PlainTextBuilder> extends AbstractTextBuilder<T>
A builder used for plain text building. Any text fragments will be transformed to a plain text. Colored fragments are not supported.
-
-
Constructor Summary
Constructors Constructor Description PlainTextBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
compress(int textLength)
Compress current text to the given length.boolean
isPlainTextEmpty()
protected java.lang.String
toAppendableText(java.lang.String text)
java.lang.String
toPlainText()
-
Methods inherited from class com.nomagic.text.builders.AbstractTextBuilder
append, appendColor, appendToText, isTextAdded, prepend, prependColor, prependToText, replaceText, setText, textLength, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.nomagic.text.builders.TextBuilder
append, appendWithNoWrap, isColorSupported, prepend, prependWithNoWrap, setColor, setText
-
-
-
-
Method Detail
-
toAppendableText
protected java.lang.String toAppendableText(java.lang.String text)
- Overrides:
toAppendableText
in classAbstractTextBuilder<T extends PlainTextBuilder>
-
compress
public void compress(int textLength)
Description copied from interface:TextBuilder
Compress current text to the given length. This function is not supported in every implementation, so it can be ignored.- Parameters:
textLength
- text length
-
toPlainText
public java.lang.String toPlainText()
- Returns:
- result string as plain text
-
isPlainTextEmpty
public boolean isPlainTextEmpty()
- Returns:
- true if text converted to a plain is empty in this builder
-
-