public static class TruncatedString.Builder extends Object
TruncatedString.| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
TruncatedString.Builder |
addText(String text)
Adds a chunk of text to the builder.
|
TruncatedString |
build()
Builds the
TruncatedString. |
TruncatedString.Builder |
setChunkOnNewlines()
Sets truncator to chunk on newlines rather than the chunks.
|
TruncatedString.Builder |
setTruncateStart()
Sets truncator to remove excess text from the start, rather than the end.
|
TruncatedString.Builder |
withTruncationText(String truncationText)
Sets the truncation text.
|
public TruncatedString build()
TruncatedString.TruncatedString.public TruncatedString.Builder addText(@NonNull String text)
text - the chunk of text to append to this builderpublic TruncatedString.Builder withTruncationText(@NonNull String truncationText)
truncationText - the text to append on overflowpublic TruncatedString.Builder setTruncateStart()
public TruncatedString.Builder setChunkOnNewlines()
Copyright © 2016–2021. All rights reserved.