Class FetchQuery<T extends CDAResource>


  • 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 Detail

      • FetchQuery

        public FetchQuery​(java.lang.Class<T> type,
                          CDAClient client)
        Create a FetchQuery for the given type, using the client.
        Parameters:
        type - is the ContentType class to be queried for.
        client - a valid client to be used for the actual data retrieval.
    • Method Detail

      • one

        public T one​(java.lang.String id)
        Fetch and return a resource matching the given id.
        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 given id.
        Type Parameters:
        C - callback type.
        Parameters:
        id - resource id.
        callback - callback.
        Returns:
        the given callback instance.
      • all

        public CDAArray all()
        Fetch and return all resources matching the type of this query.
        Returns:
        CDAArray result.
      • 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 callback instance.