1 package com.smartdevicelink.proxy.rpc;
\r
3 import java.util.Hashtable;
\r
4 import java.util.Vector;
\r
6 import com.smartdevicelink.proxy.RPCStruct;
\r
7 import com.smartdevicelink.proxy.constants.Names;
\r
8 import com.smartdevicelink.proxy.rpc.enums.HMILevel;
\r
11 * Defining sets of parameters, which are permitted or prohibited for a given RPC.
\r
12 * <p><b>Parameter List
\r
13 * <table border="1" rules="all">
\r
17 * <th>Description</th>
\r
18 * <th>SmartDeviceLink Ver. Available</th>
\r
23 * <td>A set of all parameters that are permitted for this given RPC.
\r
25 * <li>Min size: 0</li>
\r
26 * <li>Max size: 100</li>
\r
27 * <li>Max length: 100</li>
\r
30 * <td>SmartDeviceLink 2.0</td>
\r
33 * <td>userDisallowed</td>
\r
35 * <td>A set of all parameters that are prohibated for this given RPC.
\r
37 * <li>Min size: 0</li>
\r
38 * <li>Max size: 100</li>
\r
39 * <li>Max length: 100</li>
\r
42 * <td>SmartDeviceLink 2.0</td>
\r
45 * @since SmartDeviceLink 2.0
\r
47 public class ParameterPermissions extends RPCStruct {
\r
50 * Constructs a newly allocated ParameterPermissions object
\r
52 public ParameterPermissions() { }
\r
55 * Constructs a newly allocated ParameterPermissions object indicated by the Hashtable parameter
\r
56 * @param hash The Hashtable to use
\r
58 public ParameterPermissions(Hashtable hash) {
\r
63 * get a set of all parameters that are permitted for this given RPC.
\r
64 * @return a set of all parameters that are permitted for this given RPC.
\r
66 public Vector<String> getAllowed() {
\r
67 if (store.get(Names.allowed) instanceof Vector<?>) {
\r
68 Vector<?> list = (Vector<?>)store.get( Names.allowed);
\r
69 if (list != null && list.size() > 0) {
\r
70 Object obj = list.get(0);
\r
71 if (obj instanceof String) {
\r
72 return (Vector<String>) list;
\r
80 * set a set of all parameters that are permitted for this given RPC.
\r
81 * @param allowed parameter that is permitted for this given RPC
\r
83 public void setAllowed(HMILevel allowed) {
\r
84 if (allowed != null) {
\r
85 store.put(Names.allowed, allowed);
\r
87 store.remove(Names.allowed);
\r
92 * get a set of all parameters that are prohibited for this given RPC.
\r
93 * @return a set of all parameters that are prohibited for this given RPC
\r
95 public Vector<String> getUserDisallowed() {
\r
96 if (store.get(Names.userDisallowed) instanceof Vector<?>) {
\r
97 Vector<?> list = (Vector<?>)store.get( Names.userDisallowed);
\r
98 if (list != null && list.size() > 0) {
\r
99 Object obj = list.get(0);
\r
100 if (obj instanceof String) {
\r
101 return (Vector<String>) list;
\r
109 * set a set of all parameters that are prohibited for this given RPC.
\r
110 * @param userDisallowed paramter that is prohibited for this given RPC
\r
112 public void setUserDisallowed(HMILevel userDisallowed) {
\r
113 if (userDisallowed != null) {
\r
114 store.put(Names.userDisallowed, userDisallowed);
\r
116 store.remove(Names.userDisallowed);
\r