1 package com.smartdevicelink.proxy.rpc;
\r
3 import java.util.Hashtable;
\r
5 import com.smartdevicelink.proxy.RPCStruct;
\r
6 import com.smartdevicelink.proxy.constants.Names;
\r
7 import com.smartdevicelink.util.DebugTool;
\r
9 public class PermissionItem extends RPCStruct {
\r
11 public PermissionItem() { }
\r
12 public PermissionItem(Hashtable hash) {
\r
15 public String getRpcName() {
\r
16 return (String) store.get(Names.rpcName);
\r
18 public void setRpcName(String rpcName) {
\r
19 if (rpcName != null) {
\r
20 store.put(Names.rpcName, rpcName);
\r
22 store.remove(Names.rpcName);
\r
25 public HMIPermissions getHMIPermissions() {
\r
26 Object obj = store.get(Names.hmiPermissions);
\r
27 if (obj instanceof HMIPermissions) {
\r
28 return (HMIPermissions) obj;
\r
29 } else if (obj instanceof Hashtable) {
\r
31 return new HMIPermissions((Hashtable) obj);
\r
32 } catch (Exception e) {
\r
33 DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.hmiPermissions, e);
\r
38 public void setHMIPermissions(HMIPermissions hmiPermissions) {
\r
39 if (hmiPermissions != null) {
\r
40 store.put(Names.hmiPermissions, hmiPermissions);
\r
42 store.remove(Names.hmiPermissions);
\r
45 public ParameterPermissions getParameterPermissions() {
\r
46 Object obj = store.get(Names.parameterPermissions);
\r
47 if (obj instanceof ParameterPermissions) {
\r
48 return (ParameterPermissions) obj;
\r
49 } else if (obj instanceof Hashtable) {
\r
51 return new ParameterPermissions((Hashtable) obj);
\r
52 } catch (Exception e) {
\r
53 DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.parameterPermissions, e);
\r
58 public void setParameterPermissions(ParameterPermissions parameterPermissions) {
\r
59 if (parameterPermissions != null) {
\r
60 store.put(Names.parameterPermissions, parameterPermissions);
\r
62 store.remove(Names.parameterPermissions);
\r