Package me.croabeast.takion.channel
Interface ChannelManager
public interface ChannelManager
Provides methods to manage and identify communication channels based on delimiters.
A ChannelManager allows you to set and retrieve the start and end delimiters that define
a channel within a message, as well as identify the appropriate channel based on an input string.
These delimiters can be used to parse and segregate parts of a message for custom formatting or routing.
- See Also:
-
Method Summary
Modifier and TypeMethodDescription@NotNull StringRetrieves the end delimiter used to identify a channel in a message.@NotNull StringRetrieves the start delimiter used to identify a channel in a message.@NotNull ChannelIdentifies and returns the appropriateChannelbased on the provided string.voidsetEndDelimiter(@NotNull String delimiter) Sets the end delimiter to be used for channel identification.voidsetStartDelimiter(@NotNull String delimiter) Sets the start delimiter to be used for channel identification.
-
Method Details
-
getStartDelimiter
Retrieves the start delimiter used to identify a channel in a message.- Returns:
- the start delimiter as a
String
-
setStartDelimiter
Sets the start delimiter to be used for channel identification.- Parameters:
delimiter- the new start delimiter (must not benull)
-
getEndDelimiter
Retrieves the end delimiter used to identify a channel in a message.- Returns:
- the end delimiter as a
String
-
setEndDelimiter
Sets the end delimiter to be used for channel identification.- Parameters:
delimiter- the new end delimiter (must not benull)
-
identify
Identifies and returns the appropriateChannelbased on the provided string.The method uses the configured start and end delimiters to parse the input and determine which channel the message belongs to.
- Parameters:
string- the input string from which to identify the channel (must not benull)- Returns:
- the identified
Channel
-