|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface GraphObject
GraphObject is the primary interface used by the Facebook SDK for Android to represent objects in the Facebook
Social Graph and the Facebook Open Graph (OG). It is the base interface for all typed access to graph objects
in the SDK. No concrete classes implement GraphObject or its derived interfaces. Rather, they are implemented as
proxies (see the Factory
class) that provide strongly-typed property
getters and setters to access the underlying data. Since the primary use case for graph objects is sending and
receiving them over the wire to/from Facebook services, they are represented as JSONObjects. No validation is done
that a graph object is actually of a specific type -- any graph object can be treated as any GraphObject-derived
interface, and the presence or absence of specific properties determines its suitability for use as that
particular type of object.
Nested Class Summary | |
---|---|
static class |
GraphObject.Factory
Creates proxies that implement GraphObject, GraphObjectList, and their derived types. |
Method Summary | ||
---|---|---|
Map<String,Object> |
asMap()
Returns a Java Collections map of names and properties. |
|
|
cast(Class<T> graphObjectClass)
Returns a new proxy that treats this graph object as a different GraphObject-derived type. |
|
JSONObject |
getInnerJSONObject()
Gets the underlying JSONObject representation of this graph object. |
|
Object |
getProperty(String propertyName)
Gets a property of the GraphObject |
|
void |
removeProperty(String propertyName)
Removes a property of the GraphObject |
|
void |
setProperty(String propertyName,
Object propertyValue)
Sets a property of the GraphObject |
Method Detail |
---|
<T extends GraphObject> T cast(Class<T> graphObjectClass)
graphObjectClass
- the type of GraphObject to return
Map<String,Object> asMap()
JSONObject getInnerJSONObject()
Object getProperty(String propertyName)
propertyName
- the name of the property to get
void setProperty(String propertyName, Object propertyValue)
propertyName
- the name of the property to setpropertyValue
- the value of the named property to setvoid removeProperty(String propertyName)
propertyName
- the name of the property to remove
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |