Package io.jenkins.plugins.checks.api
Class TruncatedString.Builder
- java.lang.Object
-
- io.jenkins.plugins.checks.api.TruncatedString.Builder
-
- Enclosing class:
- TruncatedString
public static class TruncatedString.Builder extends Object
Builder forTruncatedString
.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TruncatedString.Builder
addText(String text)
Adds a chunk of text to the builder.TruncatedString
build()
Builds theTruncatedString
.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.
-
-
-
Method Detail
-
build
public TruncatedString build()
Builds theTruncatedString
.- Returns:
- the build
TruncatedString
.
-
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
-
-