RequestParameters

public class RequestParameters

RequestParameters conveys data to display and the way to process the display, and contains the complete content to display.

Methods

addMenuEntry

public void addMenuEntry(MenuEntry menuEntry)

Adds a menu entry to the list of entries. Refer to getMenuEntries() for more information.

create

public static RequestParameters create()

Creates an instance of RequestParameters

createPrompt

public static RequestParameters createPrompt(String prompt, String placeholderText, String format, CharacterMaskType characterMaskType, Integer min, Integer max, InputType inputType)

Creates an instance of RequestParameters for requesting user input on device

Parameters:
  • prompt: – Text to display on the screen

  • placeholderText: – Optional. Default prepopulated text

  • format: – Optional. Text mask to format the user input

  • characterMask: – Optional. Mask the user data entry CharacterMaskType

  • min: – Optional. Minimum number of characters

  • max: – Optional. Maximum number of characters

  • inputType: – Optional. Type of data to collect InputType

createQuestion

public static RequestParameters createQuestion(String title, String prompt, String buttonLeftText, String buttonRightText)

Creates an instance of RequestParameters for Customer Question

Parameters:
  • title: – Optional. Text to display on top of the screen

  • prompt: – Optional. Text to display on the screen

  • buttonLeftText: – Optional. Left button text.

  • rightLeftText: – Optional. Right button text.

getContent

public String getContent()

Returns the content that should be displayed to the cashier according to the type. If the type is InputType.MENU_OPTIONS, then this should be displayed as a header above the menu options.

getContentType

public ContentType getContentType()

Returns the content type.

getDefaultValue

public String getDefaultValue()

Refer to UserInputEvent.getDefaultValue().

getImage

public Image getImage()

Returns a bitmap that is to be displayed below the content to the recipient of the request. Generally used for confirming a customer’s signature.

getInputSubcommand

public InputSubcommand getInputSubcommand()

Refer to UserInputEvent.getInputSubcommand().

getInputType

public InputType getInputType()

Refer to UserInputEvent.getInputType().

getMaximumDecimalLength

public Integer getMaximumDecimalLength()

Maximum length of an entered string, or maximum number of entries that can be selected in a menu. Null if not specified. Greater or equal to MinLength. InputCommand must be InputType.TEXT, InputType.NUMBER, InputType.DECIMAL, InputType.PASSWORD or InputType.MENU_OPTIONS.

getMaximumInputTime

public Integer getMaximumInputTime()

Time limit in seconds to send the response, or 0 if unlimited.

getMaximumLength

public Integer getMaximumLength()

Maximum input length of the decimal part (without decimal point). Null if not specified. Greater than MinLength, lower than MaxLength. Not allowed if InputCommand is not InputType.DECIMAL.

getMenuEntries

public ArrayList<MenuEntry> getMenuEntries()

If the input type is InputType.MENU_OPTIONS, and the event type is REQUEST_TYPE, then this contains the menu options that should be offered to the cashier.

getMinimumLength

public Integer getMinimumLength()

Minimum length of an entered string, or minimum number of entries that can be selected in a menu. Null if not specified. Lower or equal to MaxLength. InputCommand must be InputType.TEXT, InputType.NUMBER, InputType.DECIMAL, InputType.PASSWORD or InputType.MENU_OPTIONS.

getSignature

public Image getSignature()

Refer to UserInputEvent.getSignature().

getStringMask

public String getStringMask()

String mask to get information according to a specific format. Supports symbols ‘d’ for digits 0-9, ‘w’ for case insensitive letters (e.g. [a-zA-Z]), and ‘.’ for any printable character. Any other characters should be preserved as-is. Example: Setting the mask to “(ddd) ddd-dddd” will collect a US-style phone number, where the user will be prompted to input 9 digits, and the returned value will look like “(626) 555-5555”. InputCommand must be InputType.TEXT, InputType.NUMBER, InputType.DECIMAL or InputType.PASSWORD.

isFromRightToLeft

public boolean isFromRightToLeft()

Indicates if the entered character has to be displayed from the right to the left of the display field. Useful when entering amounts for a language that normally reads from left to right. Not allowed if InputCommand is not InputType.TEXT, InputType.NUMBER, InputType.DECIMAL or InputType.PASSWORD. Default False for locales that read left-to-right, default True when the current locale reads right-to-left.

isResponseRequired

public boolean isResponseRequired()

Returns true if this event requires a response, otherwise this is false and everything will continue without a response.

setContent

public void setContent(String content)

Sets the content that should be displayed according to the content type. If the type is InputType.MENU_OPTIONS, then this should be displayed as a header above the menu options.

setContentType

public void setContentType(ContentType contentType)

Sets the content type according to the enumeration.

setDefaultValue

public void setDefaultValue(String defaultValue)

Configures the default for the request. Refer to UserInputEvent.getDefaultValue().

setFromRightToLeft

public void setFromRightToLeft(boolean fromRightToLeft)

Refer to isFromRightToLeft().

setImage

public void setImage(Image image)

Refer to getImage().

setInputSubcommand

public void setInputSubcommand(InputSubcommand inputSubcommand)

Configures the input sbcommand for the request. Refer to UserInputEvent.getInputSubcommand().

setInputType

public void setInputType(InputType inputType)

Configures the input type for the request. Refer to UserInputEvent.getInputType().

setMaximumDecimalLength

public void setMaximumDecimalLength(Integer maximumDecimalLength)

Refer to getMaximumDecimalLength().

setMaximumInputTime

public void setMaximumInputTime(Integer maximumInputTime)

Sets the Time limit in seconds to send the response.

setMaximumLength

public void setMaximumLength(Integer maximumLength)

Sets the Maximum length of an entered string, or maximum number of entries that can be selected in a menu.# Refer to getMaximumLength().

setMenuEntries

public void setMenuEntries(ArrayList<MenuEntry> menuEntries)

Sets all of the menu entries at once. Refer to getMenuEntries() for more information.

setMinimumLength

public void setMinimumLength(Integer minimumLength)

Sets the Minimum length of an entered string, or minimum number of entries that can be selected in a menu. Refer to getMinimumLength().

setResponseRequired

public void setResponseRequired(boolean responseRequired)

Refer to isResponseRequired().

setShouldMaskCharacters

public void setShouldMaskCharacters(boolean shouldMaskCharacters)

Refer to shouldMaskCharacters().

setShouldRespondImmediately

public void setShouldRespondImmediately(boolean shouldRespondImmediately)

Sets shouldRespondImmediately for UserInputEvent.

setShouldWaitForUserValidation

public void setShouldWaitForUserValidation(boolean wait)

Refer to shouldWaitForUserValidation().

setSignature

public void setSignature(Image signature)

setStringMask

public void setStringMask(String stringMask)

Refer to getStringMask().

shouldMaskCharacters

public boolean shouldMaskCharacters()

Indicates that the entry should be masked with an ‘#’ or similar character while being entered. InputCommand must be InputType.TEXT, InputType.NUMBER or InputType.PASSWORD. Default False.

shouldRespondImmediately

public boolean shouldRespondImmediately()

Returns true if setShouldRespondImmediately is set for an UserInputEvent. setShouldRespondImmediately

shouldWaitForUserValidation

public boolean shouldWaitForUserValidation()

Indicates that the user must confirm the entered characters when the maximum allowed length is reached. InputCommand must be InputType.TEXT, InputType.NUMBER or InputType.DECIMAL with setMaximumLength(Integer) or setMaximumDecimalLength(Integer). Default False.