|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.AbstractMap<String,Object> com.ecwid.mailchimp.MailChimpObject
public class MailChimpObject
Base class for all objects wrapping MailChimp API calls. Since this object is generally a map, its mappings are used to serilize/deserialize the object to/from JSON.
Some entries in the map are regular mappings, whereas others are reflective ones.
Reflective mappings are represented by fields marked with the MailChimpObject.Field
annotation.
Changes in such fields are reflected in the map and vice versa.
Reflective mappings cannot be removed from this map.
Nested Class Summary | |
---|---|
protected static interface |
MailChimpObject.Field
Marks fields to be serialized/deserialed to/from JSON. |
Nested classes/interfaces inherited from class java.util.AbstractMap |
---|
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V> |
Nested classes/interfaces inherited from interface java.util.Map |
---|
Map.Entry<K,V> |
Constructor Summary | |
---|---|
MailChimpObject()
Default constructior. |
Method Summary | ||
---|---|---|
|
as(Class<T> clazz)
Converts this object to another object of class clazz . |
|
void |
clear()
Unsupported operation. |
|
boolean |
containsKey(Object key)
|
|
Set<Map.Entry<String,Object>> |
entrySet()
|
|
static
|
fromJson(String json,
Class<T> clazz)
Deserializes an object from JSON. |
|
Object |
get(Object key)
|
|
Map<String,Type> |
getReflectiveMappingTypes()
Get desciption of the reflective mappings in this object. |
|
static Map<String,Type> |
getReflectiveMappingTypes(Class<? extends MailChimpObject> clazz)
Get desciption of the reflective mappings in class clazz . |
|
Set<String> |
keySet()
|
|
Object |
put(String key,
Object value)
|
|
Object |
remove(Object key)
Removes a regular mapping for a key from this map if it is present. |
|
int |
size()
|
|
String |
toJson()
Serializes this object to JSON. |
Methods inherited from class java.util.AbstractMap |
---|
clone, containsValue, equals, hashCode, isEmpty, putAll, toString, values |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public MailChimpObject()
Method Detail |
---|
public static Map<String,Type> getReflectiveMappingTypes(Class<? extends MailChimpObject> clazz)
clazz
.
public Map<String,Type> getReflectiveMappingTypes()
public Object get(Object key)
get
in interface Map<String,Object>
get
in class AbstractMap<String,Object>
public Object put(String key, Object value)
put
in interface Map<String,Object>
put
in class AbstractMap<String,Object>
public Object remove(Object key)
remove
in interface Map<String,Object>
remove
in class AbstractMap<String,Object>
key
- key for a regular mapping
IllegalArgumentException
- if key is associated with a reflective mappingpublic boolean containsKey(Object key)
containsKey
in interface Map<String,Object>
containsKey
in class AbstractMap<String,Object>
public int size()
size
in interface Map<String,Object>
size
in class AbstractMap<String,Object>
public void clear()
clear
in interface Map<String,Object>
clear
in class AbstractMap<String,Object>
public Set<String> keySet()
keySet
in interface Map<String,Object>
keySet
in class AbstractMap<String,Object>
public Set<Map.Entry<String,Object>> entrySet()
entrySet
in interface Map<String,Object>
entrySet
in class AbstractMap<String,Object>
public final String toJson()
public static <T extends MailChimpObject> T fromJson(String json, Class<T> clazz)
IllegalArgumentException
- if json
cannot be deserialized to an object of class clazz
.public <T extends MailChimpObject> T as(Class<T> clazz)
clazz
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |