public class ChatPaginator extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ChatPaginator.ChatPage |
Modifier and Type | Field and Description |
---|---|
static int |
AVERAGE_CHAT_PAGE_WIDTH |
static int |
CLOSED_CHAT_PAGE_HEIGHT |
static int |
GUARANTEED_NO_WRAP_CHAT_PAGE_WIDTH |
static int |
OPEN_CHAT_PAGE_HEIGHT |
static int |
UNBOUNDED_PAGE_HEIGHT |
static int |
UNBOUNDED_PAGE_WIDTH |
Constructor and Description |
---|
ChatPaginator() |
Modifier and Type | Method and Description |
---|---|
static @NotNull ChatPaginator.ChatPage |
paginate(@Nullable String unpaginatedString,
int pageNumber)
Breaks a raw string up into pages using the default width and height.
|
static @NotNull ChatPaginator.ChatPage |
paginate(@Nullable String unpaginatedString,
int pageNumber,
int lineLength,
int pageHeight)
Breaks a raw string up into pages using a provided width and height.
|
static @NotNull String[] |
wordWrap(@Nullable String rawString,
int lineLength)
Breaks a raw string up into a series of lines.
|
public static final int GUARANTEED_NO_WRAP_CHAT_PAGE_WIDTH
public static final int AVERAGE_CHAT_PAGE_WIDTH
public static final int UNBOUNDED_PAGE_WIDTH
public static final int OPEN_CHAT_PAGE_HEIGHT
public static final int CLOSED_CHAT_PAGE_HEIGHT
public static final int UNBOUNDED_PAGE_HEIGHT
@NotNull public static @NotNull ChatPaginator.ChatPage paginate(@Nullable @Nullable String unpaginatedString, int pageNumber)
unpaginatedString
- The raw string to break.pageNumber
- The page number to fetch.@NotNull public static @NotNull ChatPaginator.ChatPage paginate(@Nullable @Nullable String unpaginatedString, int pageNumber, int lineLength, int pageHeight)
unpaginatedString
- The raw string to break.pageNumber
- The page number to fetch.lineLength
- The desired width of a chat line.pageHeight
- The desired number of lines in a page.@NotNull public static @NotNull String[] wordWrap(@Nullable @Nullable String rawString, int lineLength)
rawString
- The raw string to break.lineLength
- The length of a line of text.Copyright © 2021. All rights reserved.