Package net.dv8tion.jda.api
Interface MessageBuilder.SplitPolicy
-
- All Known Implementing Classes:
MessageBuilder.SplitPolicy.CharSequenceSplitPolicy
- Enclosing class:
- MessageBuilder
public static interface MessageBuilder.SplitPolicy
Interface to allow custom implementation of Splitting rules forMessageBuilder.buildAll(SplitPolicy...)
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
MessageBuilder.SplitPolicy.CharSequenceSplitPolicy
DefaultMessageBuilder.SplitPolicy
implementation.
-
Field Summary
Fields Modifier and Type Field Description static MessageBuilder.SplitPolicy
ANYWHERE
Splits exactly after 2000 chars.static MessageBuilder.SplitPolicy
NEWLINE
Splits on newline chars`\n`
.static MessageBuilder.SplitPolicy
SPACE
Splits on space chars` `
.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description int
nextMessage(int currentBeginIndex, MessageBuilder builder)
Calculates the endIndex for the nextMessage
.static MessageBuilder.SplitPolicy
onChars(java.lang.CharSequence chars, boolean remove)
Creates a newMessageBuilder.SplitPolicy
splitting on the specified chars.
-
-
-
Field Detail
-
NEWLINE
static final MessageBuilder.SplitPolicy NEWLINE
Splits on newline chars`\n`
.
-
SPACE
static final MessageBuilder.SplitPolicy SPACE
Splits on space chars` `
.
-
ANYWHERE
static final MessageBuilder.SplitPolicy ANYWHERE
Splits exactly after 2000 chars.
-
-
Method Detail
-
onChars
@Nonnull static MessageBuilder.SplitPolicy onChars(@Nonnull java.lang.CharSequence chars, boolean remove)
Creates a newMessageBuilder.SplitPolicy
splitting on the specified chars.- Parameters:
chars
- the chars to split onremove
- whether to remove the chars when splitting on them- Returns:
- a new
MessageBuilder.SplitPolicy
-
nextMessage
int nextMessage(int currentBeginIndex, MessageBuilder builder)
Calculates the endIndex for the nextMessage
.- Parameters:
currentBeginIndex
- the index the nextMessage
should start frombuilder
- theMessageBuilder
- Returns:
- the end Index of the next
Message
- Throws:
java.lang.IllegalStateException
- when splitting fails
-
-