Class TextBuilder


  • public class TextBuilder
    extends java.lang.Object
    This class allows developers to format their text in a simple manner with automatic basic escaping; creating a more elegant solution without weird markdown escaping or manually writing HTML-formatted text. All public methods will escape their input (except TextBuilder#html(String)) and format accordingly. Keep in mind that while most places should accept an instance of this builder as valid input, using TextBuilder#toHtml() requires that you specify the parse mode to HTML in the request you're sending.
    See Also:
    SendText.SendTextBuilder.text(TextBuilder)
    • Constructor Detail

      • TextBuilder

        protected TextBuilder()
    • Method Detail

      • plain

        public TextBuilder plain​(java.lang.String text)
      • escaped

        public TextBuilder escaped​(java.lang.String text)
      • html

        public TextBuilder html​(java.lang.String html)
      • bold

        public TextBuilder bold​(java.lang.String text)
      • italics

        public TextBuilder italics​(java.lang.String text)
      • link

        public TextBuilder link​(java.lang.String text,
                                java.lang.String link)
      • code

        public TextBuilder code​(java.lang.String text)
      • preformatted

        public TextBuilder preformatted​(java.lang.String text)
      • toHtml

        public java.lang.String toHtml()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object