Expand Minimize Picture-in-picture Power Device Status Voice Recognition Skip Back Skip Forward Minus Plus Play Search
Documentation
Sidebar

Class Choice

Hierarchy

java.lang.Object
     com.smartdevicelink.proxy.RPCStruct

Package
com.smartdevicelink.proxy.rpc

Overview

A choice is an option which a user can select either via the menu or via voice recognition (VR) during an application initiated interaction. For example, the application may request for the user`s choice among several suggested ones: Yes, No, Skip.

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

Fields

KEY_SECONDARY_TEXT

public static final java.lang.String KEY_SECONDARY_TEXT
Constant Value
"secondaryText"

KEY_TERTIARY_TEXT

public static final java.lang.String KEY_TERTIARY_TEXT
Constant Value
"tertiaryText"

KEY_SECONDARY_IMAGE

public static final java.lang.String KEY_SECONDARY_IMAGE
Constant Value
"secondaryImage"

KEY_MENU_NAME

public static final java.lang.String KEY_MENU_NAME
Constant Value
"menuName"

KEY_VR_COMMANDS

public static final java.lang.String KEY_VR_COMMANDS
Constant Value
"vrCommands"

KEY_CHOICE_ID

public static final java.lang.String KEY_CHOICE_ID
Constant Value
"choiceID"

KEY_IMAGE

public static final java.lang.String KEY_IMAGE
Constant Value
"image"

Inherited Fields

From Class Fields
com.smartdevicelink.proxy.RPCStruct KEY_BULK_DATA, KEY_PROTECTED, store

Constructors

Choice()

Constructs a newly allocated Choice object

public Choice()

Choice( java.util.Hashtable<java.lang.String, java.lang.Object> hash )

Constructs a newly allocated Choice object indicated by the Hashtable parameter

public Choice(java.util.Hashtable<java.lang.String, java.lang.Object> hash)

Parameters

hash
The Hashtable to use

Choice( Integer choiceID, String menuName )

Constructs a newly allocated Choice object

public Choice(Integer choiceID,String menuName)

Parameters

choiceID
Min: 0 Max: 65535
menuName
the menu name

Choice( Integer choiceID, String menuName, java.util.List<java.lang.String> vrCommands )

Constructs a newly allocated Choice object

public Choice(Integer choiceID,String menuName,java.util.List<java.lang.String> vrCommands)

Parameters

choiceID
Min: 0 Max: 65535
menuName
the menu name
vrCommands
the List of vrCommands Deprecated - use {@link #Choice(Integer, String)}

Methods

format( Version rpcVersion, boolean formatParams )

VrCommands became optional as of RPC Spec 5.0. On legacy systems, we must still set VrCommands, as they are expected, even though the developer may not specify them.
Additionally, VrCommands must be unique, therefore we will use the string value of the command's ID

public void format(Version rpcVersion,boolean formatParams)

Parameters

rpcVersion
the rpc spec version that has been negotiated. If value is null the the max value of RPC spec version this library supports should be used.
formatParams
if true, the format method will be called on subsequent params

getChoiceID()

Get the application-scoped identifier that uniquely identifies this choice.

public java.lang.Integer getChoiceID()

setChoiceID( Integer choiceID )

Set the application-scoped identifier that uniquely identifies this choice.

public void setChoiceID(Integer choiceID)

Parameters

choiceID
Min: 0 Max: 65535

getMenuName()

Text which appears in menu, representing this choice. Min: 1; Max: 100

public java.lang.String getMenuName()

setMenuName( String menuName )

Text which appears in menu, representing this choice. Min: 1; Max: 100

public void setMenuName(String menuName)

Parameters

menuName
the menu name

getVrCommands()

Get 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

public java.util.List getVrCommands()

setVrCommands( java.util.List<java.lang.String> vrCommands )

Set 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

public void setVrCommands(java.util.List<java.lang.String> vrCommands)

Parameters

vrCommands
the List of vrCommands

setImage( Image image )

Set the image

public void setImage(Image image)

Parameters

image
the image of the choice

getImage()

Get the image

public com.smartdevicelink.proxy.rpc.Image getImage()

getSecondaryText()

public java.lang.String getSecondaryText()

setSecondaryText( String secondaryText )

public void setSecondaryText(String secondaryText)

Parameters

secondaryText

getTertiaryText()

public java.lang.String getTertiaryText()

setTertiaryText( String tertiaryText )

public void setTertiaryText(String tertiaryText)

Parameters

tertiaryText

setSecondaryImage( Image image )

public void setSecondaryImage(Image image)

Parameters

image

getSecondaryImage()

public com.smartdevicelink.proxy.rpc.Image getSecondaryImage()

Inherited Methods

From Class Methods
com.smartdevicelink.proxy.RPCStruct getStoreValue, getStore, deserializeJSON, deserializeJSONObject, serializeJSON, serializeJSON, format, getBulkData, setBulkData, setPayloadProtected, isPayloadProtected, getMessageTypeName, hasKey, setValue, getValue, getObject, formatObject, getValueForString, getString, getInteger, getDouble, getFloat, getBoolean, getLong
java.lang.Object getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize
View on GitHub.com
Previous Section Next Section