Interface NotificationBuilder
A notification requires at least a subject, content,
and at least one recipient (via recipientUsers or
recipientGroups). A resource is optional.
Guardrails
- Content blocks are limited to 20; blocks beyond the limit are silently dropped.
- All literal text values and translation key params are trimmed to 250 characters.
- Translation key params are limited to 10 per block.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptioncontent(Consumer<ContentBlockBuilder> configurer) Configures the content body of the notification.recipientGroups(Collection<UUID> groupIds) Adds the given group IDs to the set of recipients for this notification.recipientUsers(Collection<UUID> userIds) Adds the given user IDs to the set of recipients for this notification.Associates a resource with this notification, without a navigation path.Associates a resource with this notification, including a navigation path.subject(Consumer<TextContentBuilder> configurer) Configures the subject line of the notification.
-
Method Details
-
recipientUsers
Adds the given user IDs to the set of recipients for this notification.Calling this method more than once is cumulative — each invocation adds to the existing set of recipient users rather than replacing it.
- Parameters:
userIds- user IDs to notify; must not benull- Returns:
- this builder
-
recipientGroups
Adds the given group IDs to the set of recipients for this notification. All members of the specified groups will receive the notification.Calling this method more than once is cumulative — each invocation adds to the existing set of recipient groups rather than replacing it.
- Parameters:
groupIds- group IDs whose members should be notified; must not benull- Returns:
- this builder
-
subject
Configures the subject line of the notification.The subject is required. The configurer receives a
TextContentBuilderto set the subject text viatextortextKey.Calling this method more than once replaces the previously set subject.
- Parameters:
configurer- consumer that configures the subject content; must not benull- Returns:
- this builder
-
content
Configures the content body of the notification.The content is required. The configurer receives a
ContentBlockBuilderto compose an ordered list of content blocks (text, bold, italic, links, new lines).Calling this method more than once replaces the previously set content.
- Parameters:
configurer- consumer that configures the content blocks; must not benull- Returns:
- this builder
- See Also:
-
resource
Associates a resource with this notification, without a navigation path.The resource provides context about which entity the notification relates to. Calling this method more than once replaces the previously set resource.
- Parameters:
id- the unique identifier of the resource; must not benullname- the display name of the resource; must not benulltype- the resource type — one ofAsset,Community,Domain,User,Assessment, orDataQualityJob; must not benull- Returns:
- this builder
-
resource
Associates a resource with this notification, including a navigation path.The resource provides context about which entity the notification relates to. Calling this method more than once replaces the previously set resource.
- Parameters:
id- the unique identifier of the resource; must not benullname- the display name of the resource; must not benulltype- the resource type — one ofAsset,Community,Domain,User,Assessment, orDataQualityJob; must not benullpath- optional relative URL path, resolved against the application's base URL, used to deep-link to the resource in the UI (e.g."/asset/{id}"or"/domain/{id}?commentId={commentId}"); may benull- Returns:
- this builder
-