public class RPCStruct extends Object implements Cloneable
| Modifier and Type | Field and Description |
|---|---|
static String |
KEY_BULK_DATA |
static String |
KEY_PROTECTED |
protected Hashtable<String,Object> |
store |
| Modifier | Constructor and Description |
|---|---|
|
RPCStruct() |
|
RPCStruct(Hashtable<String,Object> hashtable) |
protected |
RPCStruct(RPCStruct rpcs) |
| Modifier and Type | Method and Description |
|---|---|
RPCStruct |
clone()
Creates a deep copy of the object
|
void |
deserializeJSON(JSONObject jsonObject) |
boolean |
equals(Object obj)
Uses the RPCStruct store for RPCStruct objects
|
void |
format(Version rpcVersion,
boolean formatParams)
This method should clean the the RPC to make sure it is compliant with the spec.
|
protected Object |
formatObject(Class tClass,
Object obj) |
Boolean |
getBoolean(String key) |
byte[] |
getBulkData() |
Double |
getDouble(String key) |
Float |
getFloat(String key) |
Integer |
getInteger(String key) |
Long |
getLong(String key) |
protected String |
getMessageTypeName(Set<String> keys) |
Object |
getObject(Class tClass,
String key) |
Hashtable<String,Object> |
getStore() |
boolean |
getStoreValue(String key) |
String |
getString(String key) |
Object |
getValue(String key) |
protected Object |
getValueForString(Class tClass,
String s) |
int |
hashCode()
Used to compile hashcode for RPCStruct
|
protected boolean |
hasKey(Set<String> keys,
String keyName) |
Boolean |
isPayloadProtected() |
JSONObject |
serializeJSON() |
JSONObject |
serializeJSON(byte protocolVersion) |
RPCStruct |
setBulkData(byte[] bulkData) |
RPCStruct |
setPayloadProtected(Boolean bVal) |
RPCStruct |
setValue(String key,
Object value) |
public static final String KEY_BULK_DATA
public static final String KEY_PROTECTED
public RPCStruct()
protected RPCStruct(RPCStruct rpcs)
public boolean getStoreValue(String key)
public void deserializeJSON(JSONObject jsonObject) throws JSONException
JSONExceptionpublic JSONObject serializeJSON() throws JSONException
JSONExceptionpublic JSONObject serializeJSON(byte protocolVersion) throws JSONException
JSONExceptionpublic void format(Version rpcVersion, boolean formatParams)
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 paramspublic byte[] getBulkData()
public RPCStruct setBulkData(byte[] bulkData)
public Boolean isPayloadProtected()
protected Object formatObject(Class tClass, Object obj)
tClass - a Class to cast Objects toobj - Object returned from a stored hashtableprotected Object getValueForString(Class tClass, String s)
tClass - - a Class with a `valueForString(String s)` method that returns an Object for a given Strings - - a String to be converted to an Object using a `valueForString(String s)` methodpublic RPCStruct clone()
public boolean equals(@Nullable
Object obj)