Class CollectionResponse<T>

  • java.lang.Object

  • public class CollectionResponse<T>
    extends java.lang.Object
    Collection response to be returned by an endpoint implementation method that wants to support pagination (and other metadata about returned collection in the future). Endpoint implementation method would do something like this to use it:

    public CollectionResponse<Greeting> list(@Named("pageToken") String pageToken) { List<Greeting> greetings = new ArrayList<Greeting>(); // use pageToken to fill greetings with next page of items return CollectionResponse.<Greeting>builder() .setItems(greetings) .setNextPageToken("newPageToken") .build(); }

    • Constructor Detail

      • CollectionResponse

        protected CollectionResponse(java.util.Collection<T> items,
                                     java.lang.String nextPageToken)
    • Method Detail

      • getNextPageToken

        public java.lang.String getNextPageToken()
      • getItems

        public java.util.Collection<T> getItems()