Class MenuCreator
java.lang.Object
com.sinch.sdk.domains.voice.models.v2.helpers.MenuCreator
Fluent creator of a
menu command, returned by Menu.create(String)
build() checks that the start menu and every Menu.gotoMenu(String) target are
items of this menu.
- Since:
- 2.4
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Build themenucommandAdd a menu itemitem(String name, Consumer<MenuItemCreator> item) Add a menu item
-
Method Details
-
item
Add a menu item- Parameters:
name- Name of the item, 1 to 16 characters. Start menu and gotoMenu targets refer to ititem- Lambda filling the item- Returns:
- This creator
- Throws:
IllegalArgumentException- if an item with this name is already defined- Since:
- 2.4
-
build
Build themenucommand- Returns:
- The command
- Throws:
IllegalStateException- if the start menu, or the target of agotoMenucommand of an item, is not an item of this menu- Since:
- 2.4
-