public static class WhatsAppTemplateMessageBuilderImpl.ComponentBuilderImpl extends Object implements WhatsAppTemplateMessageBuilder.ComponentBuilder
Modifier and Type | Field and Description |
---|---|
protected List<WhatsAppTemplateParameter> |
parameterList |
protected WhatsAppTemplateMessageBuilderImpl |
parent |
protected WhatsAppTemplateMessageBuilderImpl.Type |
type |
Constructor and Description |
---|
ComponentBuilderImpl(WhatsAppTemplateMessageBuilderImpl parent,
WhatsAppTemplateMessageBuilderImpl.Type type) |
Modifier and Type | Method and Description |
---|---|
WhatsAppTemplateMessageBuilderImpl.ComponentBuilderImpl |
addCurrencyParameter(String fallbackValue,
String code,
BigDecimal amount)
Add currency parameter.
|
WhatsAppTemplateMessageBuilderImpl.ComponentBuilderImpl |
addDateTimeParameter(String fallbackValue,
LocalDateTime dateTime,
String calendar)
Add date time parameter.
|
WhatsAppTemplateMessageBuilder.ComponentBuilder |
addImageLinkParameter(String link)
Add image link parameter
|
WhatsAppTemplateMessageBuilderImpl.ComponentBuilderImpl |
addTextParameter(String value)
Add simple text parameter
|
WhatsAppTemplateMessageBuilderImpl |
buildComponent()
Builds current component (header, body, footer or button) and adds it to the list of components of the parent builder.
|
protected WhatsAppTemplateMessageBuilderImpl parent
protected WhatsAppTemplateMessageBuilderImpl.Type type
protected final List<WhatsAppTemplateParameter> parameterList
public ComponentBuilderImpl(WhatsAppTemplateMessageBuilderImpl parent, WhatsAppTemplateMessageBuilderImpl.Type type)
public WhatsAppTemplateMessageBuilderImpl.ComponentBuilderImpl addTextParameter(String value)
WhatsAppTemplateMessageBuilder.ComponentBuilder
Note: The parameter must be added in the correct order according to the template message.
addTextParameter
in interface WhatsAppTemplateMessageBuilder.ComponentBuilder
value
- text valuepublic WhatsAppTemplateMessageBuilder.ComponentBuilder addImageLinkParameter(String link)
WhatsAppTemplateMessageBuilder.ComponentBuilder
Note: The parameter must be added in the correct order according to the template message.
addImageLinkParameter
in interface WhatsAppTemplateMessageBuilder.ComponentBuilder
link
- to the imagepublic WhatsAppTemplateMessageBuilderImpl.ComponentBuilderImpl addCurrencyParameter(String fallbackValue, String code, BigDecimal amount)
WhatsAppTemplateMessageBuilder.ComponentBuilder
Note: The parameter must be added in the correct order according to the template message.
addCurrencyParameter
in interface WhatsAppTemplateMessageBuilder.ComponentBuilder
fallbackValue
- default value, if the device is unsuccessful in localizing a parameter, it should fall back to using the fallbackValue
(e.g. $100.99)code
- currency code as defined in ISO 4217 (e.g. USD)amount
- amount multiplied by 1000 (e.g. 100990 is 100.99)public WhatsAppTemplateMessageBuilderImpl.ComponentBuilderImpl addDateTimeParameter(String fallbackValue, LocalDateTime dateTime, String calendar)
WhatsAppTemplateMessageBuilder.ComponentBuilder
Note: The parameter must be added in the correct order according to the template message.
addDateTimeParameter
in interface WhatsAppTemplateMessageBuilder.ComponentBuilder
fallbackValue
- default value, if the device is unsuccessful in localizing a parameter, it should fall back to using the fallbackValue
dateTime
- time as LocalDateTime
calendar
- type of calendar. Optional.public WhatsAppTemplateMessageBuilderImpl buildComponent()
WhatsAppTemplateMessageBuilder.ComponentBuilder
buildComponent
in interface WhatsAppTemplateMessageBuilder.ComponentBuilder