public class TruncatedString extends Object
The GitHub Checks API has a size limit on text fields. Because it also accepts markdown, it is not trivial to truncate to the required length as this could lead to unterminated syntax. The use of this class allows for adding chunks of complete markdown until an overflow is detected, at which point a message will be added and all future additions will be silently discarded.
| Modifier and Type | Class and Description |
|---|---|
static class |
TruncatedString.Builder
Builder for
TruncatedString. |
| Modifier and Type | Method and Description |
|---|---|
String |
build(int maxSize)
Builds the string such that it does not exceed maxSize, including the truncation string.
|
String |
toString()
Builds the string without truncation.
|
public String toString()
public String build(int maxSize)
maxSize - the maximum size of the resultant string.Copyright © 2016–2021. All rights reserved.