Package com.contentful.java.cda
Class FetchQuery<T extends CDAResource>
- java.lang.Object
-
- com.contentful.java.cda.AbsQuery<T,FetchQuery<T>>
-
- com.contentful.java.cda.FetchQuery<T>
-
public class FetchQuery<T extends CDAResource> extends AbsQuery<T,FetchQuery<T>>
Represents a query to the Delivery API which may be invoked synchronously or asynchronously with a callback.
-
-
Constructor Summary
Constructors Constructor Description FetchQuery(java.lang.Class<T> type, CDAClient client)Create a FetchQuery for the given type, using the client.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CDAArrayall()Fetch and return all resources matching the type of this query.<C extends CDACallback<CDAArray>>
Call(C callback)Async fetch all resources matching the type of this query.Tone(java.lang.String id)Fetch and return a resource matching the givenid.<C extends CDACallback<T>>
Cone(java.lang.String id, C callback)Async fetch resource matching the givenid.-
Methods inherited from class com.contentful.java.cda.AbsQuery
include, limit, linksToAssetId, linksToEntryId, orderBy, orderBy, reverseOrderBy, select, select, skip, where, where, withContentType, withLocale
-
-
-
-
Method Detail
-
one
public T one(java.lang.String id)
Fetch and return a resource matching the givenid.- Parameters:
id- resource id.- Returns:
- result resource, null if it does not exist.
-
one
public <C extends CDACallback<T>> C one(java.lang.String id, C callback)
Async fetch resource matching the givenid.- Type Parameters:
C- callback type.- Parameters:
id- resource id.callback- callback.- Returns:
- the given
callbackinstance.
-
all
public CDAArray all()
Fetch and return all resources matching the type of this query.- Returns:
CDAArrayresult.
-
all
public <C extends CDACallback<CDAArray>> C all(C callback)
Async fetch all resources matching the type of this query.- Type Parameters:
C- callback type.- Parameters:
callback- callback.- Returns:
- the given
callbackinstance.
-
-