|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.AbstractMap<K,V> java.util.HashMap<java.lang.String,java.lang.Object> redstone.xmlrpc.XmlRpcStruct
public class XmlRpcStruct
A Struct represents an XML-RPC struct in its Java form. Essentially, it's just a plain java.util.HashMap with utility methods for extracting members of any of the data types supported by the XML-RPC library. The class does not introduce any new field members which makes it no more expensive than a regular HashMap.
To extract nested values from the struct, use the new simplified accessors which perform the casting for you:
Date date = myStruct.getArray( "someListOfStructs" ).getStruct( 0 ).getDate( "someDate" );
Constructor Summary | |
---|---|
XmlRpcStruct()
|
Method Summary | |
---|---|
XmlRpcArray |
getArray(java.lang.Object key)
Returns the Array with the given key from the Struct. |
byte[] |
getBinary(java.lang.Object key)
Returns the byte[] with the given key from the Struct. |
java.io.InputStream |
getBinaryAsStream(java.lang.Object key)
Returns the byte[] with the given key from the Struct, as an input stream (currently, a java.io.ByteArrayInputStream). |
boolean |
getBoolean(java.lang.Object key)
Returns the boolean with the given key from the Struct. |
java.lang.Boolean |
getBooleanWrapper(java.lang.Object key)
Returns the Boolean wrapper with the given key from the Struct. |
java.util.Date |
getDate(java.lang.Object key)
Returns the Date with the given key from the Struct. |
double |
getDouble(java.lang.Object key)
Returns the double with the given key from the Struct. |
java.lang.Double |
getDoubleWrapper(java.lang.Object key)
Returns the Double wrapper with the given key from the Struct. |
int |
getInteger(java.lang.Object key)
Returns the integer with the given key from the Struct. |
java.lang.Integer |
getIntegerWrapper(java.lang.Object key)
Returns the Integer wrapper with the given key from the Struct. |
java.lang.String |
getString(java.lang.Object key)
Returns the String with the given key from the Struct. |
XmlRpcStruct |
getStruct(java.lang.Object key)
Returns the Struct with the given key from the Struct. |
long |
getTimestamp(java.lang.Object key)
Returns the long integer timestamp with the given key from the Struct. |
Methods inherited from class java.util.HashMap |
---|
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values |
Methods inherited from class java.util.AbstractMap |
---|
equals, hashCode, toString |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
---|
equals, hashCode |
Constructor Detail |
---|
public XmlRpcStruct()
Method Detail |
---|
public java.lang.String getString(java.lang.Object key)
key
- The key of the value to extract.
java.lang.ClassCastException
- if the value with the given key is not a String.public boolean getBoolean(java.lang.Object key)
key
- The key of the value to extract.
java.lang.ClassCastException
- if the value with the given key is not a Boolean.
java.lang.NullPointerException
- if a value with the given key does not exist,public java.lang.Boolean getBooleanWrapper(java.lang.Object key)
key
- The key of the value to extract.
java.lang.ClassCastException
- if the value with the given key is not a Boolean.public int getInteger(java.lang.Object key)
key
- The key of the value to extract.
java.lang.ClassCastException
- if the value with the given key is not a Integer.
java.lang.NullPointerException
- if a value with the given key does not exist,public java.lang.Integer getIntegerWrapper(java.lang.Object key)
key
- The key of the value to extract.
java.lang.ClassCastException
- if the value with the given key is not a Integer.public double getDouble(java.lang.Object key)
key
- The key of the value to extract.
java.lang.ClassCastException
- if the value with the given key is not a Double.
java.lang.NullPointerException
- if a value with the given key does not exist,public java.lang.Double getDoubleWrapper(java.lang.Object key)
key
- The key of the value to extract.
java.lang.ClassCastException
- if the value with the given key is not a Double.public XmlRpcArray getArray(java.lang.Object key)
key
- The key of the value to extract.
java.lang.ClassCastException
- if the value with the given key is not a Array.
java.lang.NullPointerException
- if a value at the given key does not exist.public XmlRpcStruct getStruct(java.lang.Object key)
key
- The key of the value to extract.
java.lang.ClassCastException
- if the value with the given key is not a Struct.public java.util.Date getDate(java.lang.Object key)
key
- The key of the value to extract.
java.lang.ClassCastException
- if the value with the given key is not a Date.public long getTimestamp(java.lang.Object key)
key
- The key of the value to extract.
java.lang.ClassCastException
- if the value with the given key is not a Date.public byte[] getBinary(java.lang.Object key)
key
- The key of the value to extract.
java.lang.ClassCastException
- if the value with the given key is not a byte[].public java.io.InputStream getBinaryAsStream(java.lang.Object key)
key
- The key of the value to extract.
java.lang.ClassCastException
- if the value with the given key is not a byte[].
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |