Package com.chatmotorapi.api.notify
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 Summary
Constructors Constructor Description Builder() -
Method Summary
Modifier and Type Method Description SlackNotificationChannelbuild()Builds and returns aSlackNotificationChannelinstance based on the builder's settings.SlackNotificationChannel.Builderchannel(String channel)Sets the Slack channel ID where messages and files will be sent.SlackNotificationChannel.BuilderchatMotor(ChatMotor chatMotor)Sets theChatMotorfor sending notifications.SlackNotificationChannel.Builderlogger(org.slf4j.Logger logger)Sets theLoggerinstance for logging operations within the treatment process.SlackNotificationChannel.Buildertoken(String token)Sets the Slack token used for authenticating requests to the Slack API.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
chatMotor
Sets theChatMotorfor sending notifications.- Parameters:
chatMotor- the ChatMotor instance to use for sending notifications- Returns:
- this builder for chaining
-
logger
Sets theLoggerinstance for logging operations within the treatment process. Default value of Logger isSlackNotificationChannel.class.getName()if not provided.- Parameters:
logger- the Logger to use- Returns:
- this builder for chaining
-
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
Sets the Slack channel ID where messages and files will be sent.- Parameters:
channel- the channel ID- Returns:
- this builder for chaining
-
build
Builds and returns aSlackNotificationChannelinstance based on the builder's settings.- Returns:
- the configured SlackNotificationChannel instance
- Throws:
IllegalArgumentException- if any required fields are not set or are invalid
-