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 Type
    Method
    Description
    @NotNull String
    Retrieves the end delimiter used to identify a channel in a message.
    @NotNull String
    Retrieves the start delimiter used to identify a channel in a message.
    @NotNull Channel
    identify(@NotNull String string)
    Identifies and returns the appropriate Channel based on the provided string.
    void
    setEndDelimiter(@NotNull String delimiter)
    Sets the end delimiter to be used for channel identification.
    void
    setStartDelimiter(@NotNull String delimiter)
    Sets the start delimiter to be used for channel identification.
  • Method Details

    • getStartDelimiter

      @NotNull @NotNull String getStartDelimiter()
      Retrieves the start delimiter used to identify a channel in a message.
      Returns:
      the start delimiter as a String
    • setStartDelimiter

      void setStartDelimiter(@NotNull @NotNull String delimiter)
      Sets the start delimiter to be used for channel identification.
      Parameters:
      delimiter - the new start delimiter (must not be null)
    • getEndDelimiter

      @NotNull @NotNull String getEndDelimiter()
      Retrieves the end delimiter used to identify a channel in a message.
      Returns:
      the end delimiter as a String
    • setEndDelimiter

      void setEndDelimiter(@NotNull @NotNull String delimiter)
      Sets the end delimiter to be used for channel identification.
      Parameters:
      delimiter - the new end delimiter (must not be null)
    • identify

      @NotNull @NotNull Channel identify(@NotNull @NotNull String string)
      Identifies and returns the appropriate Channel based 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 be null)
      Returns:
      the identified Channel