Class TruncatedString.Builder

    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • addText

        public TruncatedString.Builder addText​(@NonNull
                                               String text)
        Adds a chunk of text to the builder.
        Parameters:
        text - the chunk of text to append to this builder
        Returns:
        this builder
      • withTruncationText

        public TruncatedString.Builder withTruncationText​(@NonNull
                                                          String truncationText)
        Sets the truncation text.
        Parameters:
        truncationText - the text to append on overflow
        Returns:
        this builder
      • setTruncateStart

        public TruncatedString.Builder setTruncateStart()
        Sets truncator to remove excess text from the start, rather than the end.
        Returns:
        this builder
      • setChunkOnNewlines

        public TruncatedString.Builder setChunkOnNewlines()
        Sets truncator to chunk on newlines rather than the chunks.
        Returns:
        this builder