com.google.api.client.util
Class GenericData
java.lang.Object
java.util.AbstractMap<String,Object>
com.google.api.client.util.GenericData
- All Implemented Interfaces:
- Cloneable, Map<String,Object>
- Direct Known Subclasses:
- AccessTokenErrorResponse, AccessTokenErrorResponse, AccessTokenRequest, AccessTokenRequest, AccessTokenResponse, AccessTokenResponse, AuthorizationResponse, GenericJson, GenericUrl, GenericXml, HttpHeaders, JsonRpcRequest
public class GenericData
- extends AbstractMap<String,Object>
- implements Cloneable
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.
- Since:
- 1.0
- Author:
- Yaniv Inbar
| Nested classes/interfaces inherited from interface java.util.Map |
Map.Entry<K,V> |
unknownFields
public ArrayMap<String,Object> unknownFields
- Map of unknown fields.
GenericData
public GenericData()
get
public final Object get(Object name)
- Specified by:
get in interface Map<String,Object>- Overrides:
get in class AbstractMap<String,Object>
put
public final Object put(String name,
Object value)
- Specified by:
put in interface Map<String,Object>- Overrides:
put in class AbstractMap<String,Object>
set
public final void set(String name,
Object value)
- Sets the given field value (may be
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.
putAll
public final void putAll(Map<? extends String,?> map)
- Specified by:
putAll in interface Map<String,Object>- Overrides:
putAll in class AbstractMap<String,Object>
remove
public final Object remove(Object name)
- Specified by:
remove in interface Map<String,Object>- Overrides:
remove in class AbstractMap<String,Object>
entrySet
public Set<Map.Entry<String,Object>> entrySet()
- Specified by:
entrySet in interface Map<String,Object>- Specified by:
entrySet in class AbstractMap<String,Object>
clone
public GenericData clone()
- Makes a "deep" clone of the generic data, in which the clone is completely independent of the
original.
- Overrides:
clone in class AbstractMap<String,Object>
Copyright © 2010-2011 Google. All Rights Reserved.