T
- The Facebook typepublic class Connection<T> extends Object implements Iterable<List<T>>
Constructor and Description |
---|
Connection(FacebookClient facebookClient,
String json,
Class<T> connectionType)
Creates a connection with the given
jsonObject . |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object object) |
String |
getAfterCursor() |
String |
getBeforeCursor() |
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.
|
Long |
getTotalCount()
provides the total count of elements, if FB provides them (API >= v2.0)
|
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() |
forEach, spliterator
public Connection(FacebookClient facebookClient, String json, Class<T> connectionType)
jsonObject
.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.FacebookJsonMappingException
- If the provided json
is invalid.public Iterator<List<T>> iterator()
iterator
in interface Iterable<List<T>>
Iterable.iterator()
public String getPreviousPageUrl()
null
if there is no previous page.public String getNextPageUrl()
null
if there is no next page.public boolean hasPrevious()
true
if there is a previous page of data for this connection, false
otherwise.public boolean hasNext()
true
if there is a next page of data for this connection, false
otherwise.public Long getTotalCount()
public String getBeforeCursor()
public String getAfterCursor()
RestFB 1.31.0. Copyright © 2010-2015 Mark Allen. All Rights Reserved.