|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractMap<String,Object>
com.google.api.client.util.GenericData
public class GenericData
Generic data that stores all unknown data key name/value pairs.
Subclasses can declare fields for known data keys using the Key annotation. Each field
can be of any visibility (private, package private, protected, or public) and must not be static.
null unknown data key names are not allowed, but null data values are allowed.
Iteration order of the data keys is based on the sorted (ascending) key names of the declared fields, followed by the iteration order of all of the unknown data key name/value pairs.
Implementation is not thread-safe. For a thread-safe choice instead use an implementation of
ConcurrentMap.
| Nested Class Summary | |
|---|---|
static class |
GenericData.Flags
Flags that impact behavior of generic data. |
| 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 | |
|---|---|
GenericData()
Constructs with case-insensitive keys. |
|
GenericData(EnumSet<GenericData.Flags> flags)
|
|
| Method Summary | |
|---|---|
GenericData |
clone()
Makes a "deep" clone of the generic data, in which the clone is completely independent of the original. |
Set<Map.Entry<String,Object>> |
entrySet()
|
Object |
get(Object name)
|
ClassInfo |
getClassInfo()
Returns the class information. |
Map<String,Object> |
getUnknownKeys()
Returns the map of unknown data key name to value. |
Object |
put(String fieldName,
Object value)
|
void |
putAll(Map<? extends String,?> map)
|
Object |
remove(Object name)
|
void |
set(String fieldName,
Object value)
Sets the given field value (may be null) for the given field name. |
void |
setUnknownKeys(Map<String,Object> unknownFields)
Sets the map of unknown data key name to value. |
| Methods inherited from class java.util.AbstractMap |
|---|
clear, containsKey, containsValue, equals, hashCode, isEmpty, keySet, size, toString, values |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public GenericData()
public GenericData(EnumSet<GenericData.Flags> flags)
flags - flags that impact behavior of generic data| Method Detail |
|---|
public final Object get(Object name)
get in interface Map<String,Object>get in class AbstractMap<String,Object>
public final Object put(String fieldName,
Object value)
put in interface Map<String,Object>put in class AbstractMap<String,Object>
public final void set(String fieldName,
Object value)
null) for the given field name. Any existing value
for the field will be overwritten. It may be more slightly more efficient than
put(String, Object) because it avoids accessing the field's original value.
public final void putAll(Map<? extends String,?> map)
putAll in interface Map<String,Object>putAll in class AbstractMap<String,Object>public final Object remove(Object name)
remove in interface Map<String,Object>remove 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 GenericData clone()
clone in class AbstractMap<String,Object>public final Map<String,Object> getUnknownKeys()
public final void setUnknownKeys(Map<String,Object> unknownFields)
public final ClassInfo getClassInfo()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||