|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractMap<K,V>
java.util.HashMap
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" );
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.util.AbstractMap |
---|
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V> |
Constructor Summary | |
---|---|
XmlRpcStruct()
|
Method Summary | |
---|---|
XmlRpcArray |
getArray(Object key)
Returns the Array with the given key from the Struct. |
byte[] |
getBinary(Object key)
Returns the byte[] with the given key from the Struct. |
InputStream |
getBinaryAsStream(Object key)
Returns the byte[] with the given key from the Struct, as an input stream (currently, a java.io.ByteArrayInputStream). |
boolean |
getBoolean(Object key)
Returns the boolean with the given key from the Struct. |
Boolean |
getBooleanWrapper(Object key)
Returns the Boolean wrapper with the given key from the Struct. |
Date |
getDate(Object key)
Returns the Date with the given key from the Struct. |
double |
getDouble(Object key)
Returns the double with the given key from the Struct. |
Double |
getDoubleWrapper(Object key)
Returns the Double wrapper with the given key from the Struct. |
int |
getInteger(Object key)
Returns the integer with the given key from the Struct. |
Integer |
getIntegerWrapper(Object key)
Returns the Integer wrapper with the given key from the Struct. |
String |
getString(Object key)
Returns the String with the given key from the Struct. |
XmlRpcStruct |
getStruct(Object key)
Returns the Struct with the given key from the Struct. |
long |
getTimestamp(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 String getString(Object key)
key
- The key of the value to extract.
ClassCastException
- if the value with the given key is not a String.public boolean getBoolean(Object key)
key
- The key of the value to extract.
ClassCastException
- if the value with the given key is not a Boolean.
NullPointerException
- if a value with the given key does not exist,public Boolean getBooleanWrapper(Object key)
key
- The key of the value to extract.
ClassCastException
- if the value with the given key is not a Boolean.public int getInteger(Object key)
key
- The key of the value to extract.
ClassCastException
- if the value with the given key is not a Integer.
NullPointerException
- if a value with the given key does not exist,public Integer getIntegerWrapper(Object key)
key
- The key of the value to extract.
ClassCastException
- if the value with the given key is not a Integer.public double getDouble(Object key)
key
- The key of the value to extract.
ClassCastException
- if the value with the given key is not a Double.
NullPointerException
- if a value with the given key does not exist,public Double getDoubleWrapper(Object key)
key
- The key of the value to extract.
ClassCastException
- if the value with the given key is not a Double.public XmlRpcArray getArray(Object key)
key
- The key of the value to extract.
ClassCastException
- if the value with the given key is not a Array.
NullPointerException
- if a value at the given key does not exist.public XmlRpcStruct getStruct(Object key)
key
- The key of the value to extract.
ClassCastException
- if the value with the given key is not a Struct.public Date getDate(Object key)
key
- The key of the value to extract.
ClassCastException
- if the value with the given key is not a Date.public long getTimestamp(Object key)
key
- The key of the value to extract.
ClassCastException
- if the value with the given key is not a Date.public byte[] getBinary(Object key)
key
- The key of the value to extract.
ClassCastException
- if the value with the given key is not a byte[].public InputStream getBinaryAsStream(Object key)
key
- The key of the value to extract.
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 |