Class WhatsAppTemplateMessageBuilderImpl.ComponentBuilderImpl
- java.lang.Object
-
- com.flowable.engage.external.system.whatsapp.WhatsAppTemplateMessageBuilderImpl.ComponentBuilderImpl
-
- All Implemented Interfaces:
WhatsAppTemplateMessageBuilder.ComponentBuilder
- Enclosing class:
- WhatsAppTemplateMessageBuilderImpl
public static class WhatsAppTemplateMessageBuilderImpl.ComponentBuilderImpl extends Object implements WhatsAppTemplateMessageBuilder.ComponentBuilder
-
-
Field Summary
Fields Modifier and Type Field Description protected List<WhatsAppTemplateParameter>
parameterList
protected WhatsAppTemplateMessageBuilderImpl
parent
protected WhatsAppTemplateMessageBuilderImpl.Type
type
-
Constructor Summary
Constructors Constructor Description ComponentBuilderImpl(WhatsAppTemplateMessageBuilderImpl parent, WhatsAppTemplateMessageBuilderImpl.Type type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 parameterWhatsAppTemplateMessageBuilderImpl.ComponentBuilderImpl
addTextParameter(String value)
Add simple text parameterWhatsAppTemplateMessageBuilderImpl
buildComponent()
Builds current component (header, body, footer or button) and adds it to the list of components of the parent builder.
-
-
-
Field Detail
-
parent
protected WhatsAppTemplateMessageBuilderImpl parent
-
type
protected WhatsAppTemplateMessageBuilderImpl.Type type
-
parameterList
protected final List<WhatsAppTemplateParameter> parameterList
-
-
Constructor Detail
-
ComponentBuilderImpl
public ComponentBuilderImpl(WhatsAppTemplateMessageBuilderImpl parent, WhatsAppTemplateMessageBuilderImpl.Type type)
-
-
Method Detail
-
addTextParameter
public WhatsAppTemplateMessageBuilderImpl.ComponentBuilderImpl addTextParameter(String value)
Description copied from interface:WhatsAppTemplateMessageBuilder.ComponentBuilder
Add simple text parameterNote: The parameter must be added in the correct order according to the template message.
- Specified by:
addTextParameter
in interfaceWhatsAppTemplateMessageBuilder.ComponentBuilder
- Parameters:
value
- text value- Returns:
- current component builder.
-
addImageLinkParameter
public WhatsAppTemplateMessageBuilder.ComponentBuilder addImageLinkParameter(String link)
Description copied from interface:WhatsAppTemplateMessageBuilder.ComponentBuilder
Add image link parameterNote: The parameter must be added in the correct order according to the template message.
- Specified by:
addImageLinkParameter
in interfaceWhatsAppTemplateMessageBuilder.ComponentBuilder
- Parameters:
link
- to the image- Returns:
- current component builder.
-
addCurrencyParameter
public WhatsAppTemplateMessageBuilderImpl.ComponentBuilderImpl addCurrencyParameter(String fallbackValue, String code, BigDecimal amount)
Description copied from interface:WhatsAppTemplateMessageBuilder.ComponentBuilder
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.
- Specified by:
addCurrencyParameter
in interfaceWhatsAppTemplateMessageBuilder.ComponentBuilder
- 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
public WhatsAppTemplateMessageBuilderImpl.ComponentBuilderImpl addDateTimeParameter(String fallbackValue, LocalDateTime dateTime, String calendar)
Description copied from interface:WhatsAppTemplateMessageBuilder.ComponentBuilder
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.
- Specified by:
addDateTimeParameter
in interfaceWhatsAppTemplateMessageBuilder.ComponentBuilder
- 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
public WhatsAppTemplateMessageBuilderImpl buildComponent()
Description copied from interface:WhatsAppTemplateMessageBuilder.ComponentBuilder
Builds current component (header, body, footer or button) and adds it to the list of components of the parent builder.- Specified by:
buildComponent
in interfaceWhatsAppTemplateMessageBuilder.ComponentBuilder
- Returns:
- parent builder.
-
-