SDL_Android/SmartDeviceLinkAndroidProxy - added the correct version of the proxy
[profile/ivi/smartdevicelink.git] / SDL_Android / SmartDeviceLinkProxyAndroid / src / com / smartdevicelink / proxy / rpc / OnCommand.java
index a5f0eb8..94ab19f 100755 (executable)
-//
-// Copyright (c) 2013 Ford Motor Company
-//
-package com.smartdevicelink.proxy.rpc;
-
-import java.util.Hashtable;
-
-import com.smartdevicelink.proxy.RPCNotification;
-import com.smartdevicelink.proxy.constants.Names;
-import com.smartdevicelink.proxy.rpc.enums.TriggerSource;
-import com.smartdevicelink.util.DebugTool;
-
-public class OnCommand extends RPCNotification {
-
-    public OnCommand() {
-        super("OnCommand");
-    }
-    public OnCommand(Hashtable hash) {
-        super(hash);
-    }
-    public Integer getCmdID() {
-        return (Integer) parameters.get( Names.cmdID );
-    }
-    public void setCmdID( Integer cmdID ) {
-        if (cmdID != null) {
-            parameters.put(Names.cmdID, cmdID );
-        }
-    }
-    public TriggerSource getTriggerSource() {
-        Object obj = parameters.get(Names.triggerSource);
-        if (obj instanceof TriggerSource) {
-            return (TriggerSource) obj;
-        } else if (obj instanceof String) {
-            TriggerSource theCode = null;
-            try {
-                theCode = TriggerSource.valueForString((String) obj);
-            } catch (Exception e) {
-               DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.triggerSource, e);
-            }
-            return theCode;
-        }
-        return null;
-    }
-    public void setTriggerSource( TriggerSource triggerSource ) {
-        if (triggerSource != null) {
-            parameters.put(Names.triggerSource, triggerSource );
-        }
-    }
-}
+package com.smartdevicelink.proxy.rpc;\r
+\r
+import java.util.Hashtable;\r
+\r
+import com.smartdevicelink.proxy.RPCNotification;\r
+import com.smartdevicelink.proxy.constants.Names;\r
+import com.smartdevicelink.proxy.rpc.enums.TriggerSource;\r
+import com.smartdevicelink.util.DebugTool;\r
+\r
+/**\r
+ * This is called when a command was selected via VR after pressing the PTT button, or selected from the menu after \r
+ * pressing the MENU button. <p>\r
+ * <b>Note: </b>Sequence of OnHMIStatus and OnCommand notifications for user-initiated interactions is indeterminate.\r
+ * <p></p>\r
+ * <b>HMI Status Requirements:</b>\r
+ * <ul>\r
+ * HMILevel: \r
+ * <ul><li>FULL,LIMITED</li></ul>\r
+ * AudioStreamingState: \r
+ * <ul><li>Any</li></ul>\r
+ * SystemContext: \r
+ * <ul><li>Any</li></ul>\r
+ * </ul>\r
+ * <p>\r
+ * <b>Parameter List:</b>\r
+ * <table  border="1" rules="all">\r
+ * <tr>\r
+ * <th>Name</th>\r
+ * <th>Type</th>\r
+ * <th>Description</th>\r
+ * <th>Notes</th>\r
+ * <th>Applink Ver Available</th>\r
+ * </tr>\r
+ * <tr>\r
+ * <td>cmdID</td>\r
+ * <td>Int32</td>\r
+ * <td>The cmdID of the command the user selected. This is the cmdID value provided by the application in the AddCommand operation that created the command.</td>\r
+ * <td></td>\r
+ * <td>SmartDeviceLink 1.0</td>\r
+ * </tr>\r
+ * <tr>\r
+ * <td>triggerSource</td>\r
+ * <td>{@linkplain TriggerSource}</td>\r
+ * <td>Indicates whether command was selected via VR or via a menu selection (using the OKbutton).</td>\r
+ * <td></td>\r
+ * <td>SmartDeviceLink 1.0</td>\r
+ * </tr>\r
+ * </table>\r
+ * </p>\r
+ * @since SmartDeviceLink 1.0\r
+ * @see AddCommand\r
+ * @see DeleteCommand\r
+ * @see DeleteSubMenu\r
+ */\r
+public class OnCommand extends RPCNotification {\r
+       /**\r
+       *Constructs a newly allocated OnCommand object\r
+       */    \r
+    public OnCommand() {\r
+        super("OnCommand");\r
+    }\r
+    /**\r
+    *<p>Constructs a newly allocated OnCommand object indicated by the Hashtable parameter</p>\r
+    *@param hash The Hashtable to use\r
+    */    \r
+    public OnCommand(Hashtable hash) {\r
+        super(hash);\r
+    }\r
+    /**\r
+     * <p>Returns an <i>Integer</i> object representing the Command ID</p>\r
+     * @return Integer an integer representation of this object\r
+     */    \r
+    public Integer getCmdID() {\r
+        return (Integer) parameters.get( Names.cmdID );\r
+    }\r
+    /**\r
+     * <p>Sets a Command ID</p>    \r
+     * @param cmdID an integer object representing a Command ID\r
+     */    \r
+    public void setCmdID( Integer cmdID ) {\r
+        if (cmdID != null) {\r
+            parameters.put(Names.cmdID, cmdID );\r
+        }\r
+    }\r
+    /**\r
+     * <p>Returns a <I>TriggerSource</I> object which will be shown in the HMI</p>    \r
+     * @return TriggerSource a TriggerSource object\r
+     */    \r
+    public TriggerSource getTriggerSource() {\r
+        Object obj = parameters.get(Names.triggerSource);\r
+        if (obj instanceof TriggerSource) {\r
+            return (TriggerSource) obj;\r
+        } else if (obj instanceof String) {\r
+            TriggerSource theCode = null;\r
+            try {\r
+                theCode = TriggerSource.valueForString((String) obj);\r
+            } catch (Exception e) {\r
+               DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.triggerSource, e);\r
+            }\r
+            return theCode;\r
+        }\r
+        return null;\r
+    }\r
+    /**\r
+     * <p>Sets TriggerSource<br/>\r
+     * Indicates whether command was selected via VR or via a menu selection (using the OK button).</p>    \r
+     * @param triggerSource a TriggerSource object\r
+     */    \r
+    public void setTriggerSource( TriggerSource triggerSource ) {\r
+        if (triggerSource != null) {\r
+            parameters.put(Names.triggerSource, triggerSource );\r
+        }\r
+    }\r
+}\r