com.restfb
Class Connection<T>

java.lang.Object
  extended by com.restfb.Connection<T>
All Implemented Interfaces:
Iterable<List<T>>

public class Connection<T>
extends Object
implements Iterable<List<T>>

Represents a Graph API Connection type.

Author:
Mark Allen

Constructor Summary
Connection(FacebookClient facebookClient, String json, Class<T> connectionType)
          Creates a connection with the given jsonObject.
 
Method Summary
 boolean equals(Object object)
           
 List<T> getData()
          Data for this connection.
 String getNextPageUrl()
          This connection's "next page of data" URL.
 String getPreviousPageUrl()
          This connection's "previous page of data" URL.
 int hashCode()
           
 boolean hasNext()
          Does this connection have a next page of data?
 boolean hasPrevious()
          Does this connection have a previous page of data?
 Iterator<List<T>> iterator()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Connection

public Connection(FacebookClient facebookClient,
                  String json,
                  Class<T> connectionType)
Creates a connection with the given jsonObject.

Parameters:
facebookClient - The FacebookClient used to fetch additional pages and map data to JSON objects.
json - Raw JSON which must include a data field that holds a JSON array and optionally a paging field that holds a JSON object with next/previous page URLs.
connectionType - Connection type token.
Throws:
FacebookJsonMappingException - If the provided json is invalid.
Since:
1.6.7
Method Detail

iterator

public Iterator<List<T>> iterator()
Specified by:
iterator in interface Iterable<List<T>>
Since:
1.6.7
See Also:
Iterable.iterator()

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()

equals

public boolean equals(Object object)
Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

hashCode

public int hashCode()
Overrides:
hashCode in class Object
See Also:
Object.hashCode()

getData

public List<T> getData()
Data for this connection.

Returns:
Data for this connection.

getPreviousPageUrl

public String getPreviousPageUrl()
This connection's "previous page of data" URL.

Returns:
This connection's "previous page of data" URL, or null if there is no previous page.
Since:
1.5.3

getNextPageUrl

public String getNextPageUrl()
This connection's "next page of data" URL.

Returns:
This connection's "next page of data" URL, or null if there is no next page.
Since:
1.5.3

hasPrevious

public boolean hasPrevious()
Does this connection have a previous page of data?

Returns:
true if there is a previous page of data for this connection, false otherwise.

hasNext

public boolean hasNext()
Does this connection have a next page of data?

Returns:
true if there is a next page of data for this connection, false otherwise.


RestFB 1.6.8. Copyright © 2010-2011 Mark Allen. All Rights Reserved.