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 SlackNotificationChannel
build()
Builds and returns aSlackNotificationChannel
instance based on the builder's settings.SlackNotificationChannel.Builder
channel(String channel)
Sets the Slack channel ID where messages and files will be sent.SlackNotificationChannel.Builder
chatMotor(ChatMotor chatMotor)
Sets theChatMotor
for sending notifications.SlackNotificationChannel.Builder
logger(org.slf4j.Logger logger)
Sets theLogger
instance for logging operations within the treatment process.SlackNotificationChannel.Builder
token(String token)
Sets the Slack token used for authenticating requests to the Slack API.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
chatMotor
Sets theChatMotor
for sending notifications.- Parameters:
chatMotor
- the ChatMotor instance to use for sending notifications- Returns:
- this builder for chaining
-
logger
Sets theLogger
instance 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 aSlackNotificationChannel
instance based on the builder's settings.- Returns:
- the configured SlackNotificationChannel instance
- Throws:
IllegalArgumentException
- if any required fields are not set or are invalid
-