Interface TextContentBuilder
public interface TextContentBuilder
Builder for configuring text content inside a notification block.
Exactly one of text(String) or textKey(String, String...) must be called.
If neither is called, the notification will fail to build. If both are called, the last one wins.
Guardrails
- Literal text values (
text(String)) are trimmed to 250 characters (with...). - Translation key param values are trimmed to 250 characters each (with
...). - Translation key params are limited to 10; params beyond the limit are silently dropped.
-
Method Summary
Modifier and TypeMethodDescriptionSets a literal text value for this content block.Sets a translation key (with optional parameters) for this content block.
-
Method Details
-
text
Sets a literal text value for this content block.Exactly one of
text(String)ortextKey(String, String...)must be called. If both are called, the last one wins.Calling this method more than once replaces the previously set value.
- Parameters:
value- the literal text to display; must not benull. Trimmed to 250 characters (with...) if it exceeds the limit.- Returns:
- this builder
-
textKey
Sets a translation key (with optional parameters) for this content block. The key is resolved at render time based on the recipient's locale.Exactly one of
text(String)ortextKey(String, String...)must be called. If both are called, the last one wins.Calling this method more than once replaces the previously set key and params.
- Parameters:
key- the translation key to resolve; must not benullparams- positional parameters substituted into the translated template. Each param is trimmed to 250 characters; at most 10 params are accepted — extras are silently dropped.- Returns:
- this builder
-