public class GenericTemplateElementBuilder extends Object
GenericTemplateElement.| Modifier and Type | Method and Description |
|---|---|
GenericTemplateElementBuilder |
addButton(Button button)
Adds a button to the current
GenericTemplateElement. |
GenericTemplateElementBuilder |
addBuyButton(String payload,
PaymentSummary paymentSummary)
Adds a buy button on a generic template.
|
GenericTemplateElementBuilder |
addLoginButton(String url)
Adds a login button on a generic template.
|
GenericTemplateElementBuilder |
addLogoutButton()
Adds a logout button on a generic template.
|
GenericTemplateElementBuilder |
addPhoneNumberButton(String title,
String phoneNumber)
Adds a button with a phone number to the current
GenericTemplateElement. |
GenericTemplateElementBuilder |
addPostbackButton(String title,
String payload)
Adds a button which sends a payload back when clicked to the current
GenericTemplateElement. |
GenericTemplateElementBuilder |
addShareButton()
Adds a share button on a generic template.
|
GenericTemplateElementBuilder |
addUrlButton(String title,
String url)
Adds a button which redirects to an URL when clicked to the current
GenericTemplateElement. |
GenericTemplateElementBuilder |
addUrlButton(String title,
String url,
WebViewHeightRatioType ratioType)
Adds a button which redirects to an URL when clicked to the current
GenericTemplateElement. |
GenericTemplateBuilder |
endElement()
Builds the current object, adds it to the parent builder and returns the
parent builder.
|
GenericTemplateElementBuilder |
setImage(String imageUrl)
Sets an image for the current
GenericTemplateElement. |
GenericTemplateElementBuilder |
setRedirectUrl(String itemUrl)
Sets an URL for the current
GenericTemplateElement. |
GenericTemplateElementBuilder |
setSubtitle(String subtitle)
Sets a subtitle for the current
GenericTemplateElement. |
String |
toString() |
public GenericTemplateElementBuilder setSubtitle(String subtitle)
GenericTemplateElement.subtitle - the subtitle to set.public GenericTemplateElementBuilder setImage(String imageUrl)
GenericTemplateElement.imageUrl - the image urlpublic GenericTemplateElementBuilder setRedirectUrl(String itemUrl)
GenericTemplateElement. The URL will
be used to redirect the user when the element is clicked.itemUrl - the item urlpublic GenericTemplateElementBuilder addUrlButton(String title, String url)
GenericTemplateElement. There can be at most 3 buttons per
element.title - the button label.url - the URL to whom redirect when clicked.public GenericTemplateElementBuilder addUrlButton(String title, String url, WebViewHeightRatioType ratioType)
GenericTemplateElement. There can be at most 3 buttons per
element.title - the button label.url - the URL to whom redirect when clicked.ratioType - the ratioType.public GenericTemplateElementBuilder addPhoneNumberButton(String title, String phoneNumber)
GenericTemplateElement. There can be at most 3 buttons per
element.title - the button label.phoneNumber - a phone number. Must be in the format '+' prefix followed by
the country code, area code and local number.public GenericTemplateElementBuilder addPostbackButton(String title, String payload)
GenericTemplateElement. There can be at most 3 buttons per
element.title - the button label.payload - the payload to send back when clicked.public GenericTemplateElementBuilder addButton(Button button)
GenericTemplateElement. There can be
at most 3 buttons per element.button - the button to add.public GenericTemplateElementBuilder addShareButton()
public GenericTemplateElementBuilder addLoginButton(String url)
url - the urlpublic GenericTemplateElementBuilder addLogoutButton()
public GenericTemplateElementBuilder addBuyButton(String payload, PaymentSummary paymentSummary)
payload - the payloadpaymentSummary - the payment summarypublic GenericTemplateBuilder endElement()
Copyright © 2017 BotMill. All rights reserved.