Interface WhatsAppTemplateMessageBuilder.ComponentBuilder
-
- All Known Implementing Classes:
WhatsAppTemplateMessageBuilderImpl.ComponentBuilderImpl
- Enclosing interface:
- WhatsAppTemplateMessageBuilder
public static interface WhatsAppTemplateMessageBuilder.ComponentBuilder
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description WhatsAppTemplateMessageBuilder.ComponentBuilder
addCurrencyParameter(String fallbackValue, String code, BigDecimal amount)
Add currency parameter.WhatsAppTemplateMessageBuilder.ComponentBuilder
addDateTimeParameter(String fallbackValue, LocalDateTime dateTime, String calendar)
Add date time parameter.WhatsAppTemplateMessageBuilder.ComponentBuilder
addImageLinkParameter(String link)
Add image link parameterWhatsAppTemplateMessageBuilder.ComponentBuilder
addTextParameter(String value)
Add simple text parameterWhatsAppTemplateMessageBuilder
buildComponent()
Builds current component (header, body, footer or button) and adds it to the list of components of the parent builder.
-
-
-
Method Detail
-
addTextParameter
WhatsAppTemplateMessageBuilder.ComponentBuilder addTextParameter(String value)
Add simple text parameterNote: The parameter must be added in the correct order according to the template message.
- Parameters:
value
- text value- Returns:
- current component builder.
-
addImageLinkParameter
WhatsAppTemplateMessageBuilder.ComponentBuilder addImageLinkParameter(String link)
Add image link parameterNote: The parameter must be added in the correct order according to the template message.
- Parameters:
link
- to the image- Returns:
- current component builder.
-
addCurrencyParameter
WhatsAppTemplateMessageBuilder.ComponentBuilder addCurrencyParameter(String fallbackValue, String code, BigDecimal amount)
Add currency parameter. The currency to be displayed is dependent on the client's language/locale.Note: The parameter must be added in the correct order according to the template message.
- Parameters:
fallbackValue
- default value, if the device is unsuccessful in localizing a parameter, it should fall back to using thefallbackValue
(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)- Returns:
- current component builder.
-
addDateTimeParameter
WhatsAppTemplateMessageBuilder.ComponentBuilder addDateTimeParameter(String fallbackValue, LocalDateTime dateTime, String calendar)
Add date time parameter. The time specified will be the same, regardless of the time zone the client is in.Note: The parameter must be added in the correct order according to the template message.
- Parameters:
fallbackValue
- default value, if the device is unsuccessful in localizing a parameter, it should fall back to using thefallbackValue
dateTime
- time asLocalDateTime
calendar
- type of calendar. Optional.- Returns:
- current component builder.
-
buildComponent
WhatsAppTemplateMessageBuilder buildComponent()
Builds current component (header, body, footer or button) and adds it to the list of components of the parent builder.- Returns:
- parent builder.
-
-