Class SlackNotificationChannel.Builder

java.lang.Object
com.chatmotorapi.api.notify.SlackNotificationChannel.Builder
Enclosing class:
SlackNotificationChannel

public static class SlackNotificationChannel.Builder
extends Object
Builder class for SlackNotificationChannel.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • chatMotor

      public SlackNotificationChannel.Builder chatMotor​(ChatMotor chatMotor)
      Sets the ChatMotor for sending notifications.
      Parameters:
      chatMotor - the ChatMotor instance to use for sending notifications
      Returns:
      this builder for chaining
    • logger

      public SlackNotificationChannel.Builder logger​(org.slf4j.Logger logger)
      Sets the Logger instance for logging operations within the treatment process. Default value of Logger is SlackNotificationChannel.class.getName() if not provided.
      Parameters:
      logger - the Logger to use
      Returns:
      this builder for chaining
    • token

      public SlackNotificationChannel.Builder token​(String token)
      Sets the Slack token used for authenticating requests to the Slack API.
      Parameters:
      token - the Slack API token
      Returns:
      this builder for chaining
    • channel

      public SlackNotificationChannel.Builder channel​(String channel)
      Sets the Slack channel ID where messages and files will be sent.
      Parameters:
      channel - the channel ID
      Returns:
      this builder for chaining
    • build

      public SlackNotificationChannel build()
      Builds and returns a SlackNotificationChannel instance based on the builder's settings.
      Returns:
      the configured SlackNotificationChannel instance
      Throws:
      IllegalArgumentException - if any required fields are not set or are invalid