public class Choice extends RPCStruct
Parameter List
| Name | Type | Description | SmartDeviceLink Ver. Available |
|---|---|---|---|
| choiceID | Integer | Application-scoped identifier that uniquely identifies this choice. Min: 0; Max: 65535 | SmartDeviceLink 1.0 |
| menuName | String | Text which appears in menu, representing this choice. Min: 1; Max: 100 | SmartDeviceLink 1.0 |
| vrCommands | String[] | An array of strings to be used as VR synonyms for this choice. If this array is provided, it must have at least one non-empty element | SmartDeviceLink 1.0 |
| image | Image | Either a static hex icon value or a binary image file name identifier (sent by PutFile). | SmartDeviceLink 2.0 |
AddCommand,
PerformInteraction,
Image| Modifier and Type | Field and Description |
|---|---|
static String |
KEY_CHOICE_ID |
static String |
KEY_IMAGE |
static String |
KEY_MENU_NAME |
static String |
KEY_SECONDARY_IMAGE |
static String |
KEY_SECONDARY_TEXT |
static String |
KEY_TERTIARY_TEXT |
static String |
KEY_VR_COMMANDS |
KEY_BULK_DATA, KEY_PROTECTED, store| Constructor and Description |
|---|
Choice()
Constructs a newly allocated Choice object
|
Choice(Hashtable<String,Object> hash)
Constructs a newly allocated Choice object indicated by the Hashtable parameter
|
Choice(Integer choiceID,
String menuName)
Constructs a newly allocated Choice object
|
| Modifier and Type | Method and Description |
|---|---|
void |
format(Version rpcVersion,
boolean formatParams)
VrCommands became optional as of RPC Spec 5.0.
|
Integer |
getChoiceID()
Get the application-scoped identifier that uniquely identifies this choice.
|
Image |
getImage()
Get the image
|
String |
getMenuName()
Text which appears in menu, representing this choice.
|
Image |
getSecondaryImage() |
String |
getSecondaryText() |
String |
getTertiaryText() |
List<String> |
getVrCommands()
Get an array of strings to be used as VR synonyms for this choice.
|
Choice |
setChoiceID(Integer choiceID)
Set the application-scoped identifier that uniquely identifies this choice.
|
Choice |
setIgnoreAddingVRItems(boolean ignoreAddingVRItems)
This prevents the @{link Choice#format} method from adding VR commands if set to true
|
Choice |
setImage(Image image)
Set the image
|
Choice |
setMenuName(String menuName)
Text which appears in menu, representing this choice.
|
Choice |
setSecondaryImage(Image image) |
Choice |
setSecondaryText(String secondaryText) |
Choice |
setTertiaryText(String tertiaryText) |
Choice |
setVrCommands(List<String> vrCommands)
Set an array of strings to be used as VR synonyms for this choice.
|
clone, deserializeJSON, equals, formatObject, getBoolean, getBulkData, getDouble, getFloat, getInteger, getLong, getMessageTypeName, getObject, getStore, getStoreValue, getString, getValue, getValueForString, hashCode, hasKey, isPayloadProtected, serializeJSON, serializeJSON, setBulkData, setPayloadProtected, setValuepublic static final String KEY_SECONDARY_TEXT
public static final String KEY_TERTIARY_TEXT
public static final String KEY_SECONDARY_IMAGE
public static final String KEY_MENU_NAME
public static final String KEY_VR_COMMANDS
public static final String KEY_CHOICE_ID
public static final String KEY_IMAGE
public Choice()
public Choice(Hashtable<String,Object> hash)
hash - The Hashtable to usepublic void format(Version rpcVersion, boolean formatParams)
Additionally, VrCommands must be unique, therefore we will use the string value of the command's ID
public Integer getChoiceID()
public Choice setChoiceID(@NonNull Integer choiceID)
choiceID - Min: 0 Max: 65535public String getMenuName()
public Choice setMenuName(@NonNull String menuName)
menuName - the menu namepublic List<String> getVrCommands()
public Choice setVrCommands(List<String> vrCommands)
vrCommands - the List of vrCommandspublic Choice setImage(Image image)
image - the image of the choicepublic Image getImage()
public String getSecondaryText()
public String getTertiaryText()
public Image getSecondaryImage()
public Choice setIgnoreAddingVRItems(boolean ignoreAddingVRItems)
ignoreAddingVRItems - - whether or not to let the format method add vr commands