Class PaginatedListResult<T>

Type Parameters:
T - the type of item returned in the result
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
AssetSearchResult, PublishChannelList, TaxonomyCategoryList, TaxonomyList

public abstract class PaginatedListResult<T> extends AssetLinksObject
Common abstract base class for all sdk results that return a paginated response.
See Also:
  • Field Details

    • items

      @SerializedName("items") @Expose protected List<com.google.gson.JsonElement> items
    • deserializedItems

      protected List<T> deserializedItems
  • Constructor Details

    • PaginatedListResult

      public PaginatedListResult()
  • Method Details

    • hasMore

      public Boolean hasMore()
      Are there more pages of results?
      Returns:
      true if more results available
    • getOffset

      public Integer getOffset()
      Get current offset of paginated results
      Returns:
      offset of results
    • getCount

      public Integer getCount()
      Get count of current results.
      Returns:
      count of item results
    • getLimit

      public Integer getLimit()
      Get current maximum limit of paginated result
      Returns:
      maximum limit for result
    • getTotalResults

      public Integer getTotalResults()
      Get total results (not just the paginated count).
      Returns:
      Total results available from search.
    • getItems

      public List<T> getItems()
      Get the list of deserialized list of items from the response as a list of Asset objects that could be either content items or digital assets.
      Returns:
      List of content base item objects
    • first

      public T first()
      Returns:
      the first item in the list of items or null if there is no item
    • isEmpty

      public boolean isEmpty()
      Returns:
      true if item list is empty
    • deserializeObject

      protected abstract T deserializeObject(com.google.gson.JsonElement jsonElement)
      Override to deserialize the list objects
      Parameters:
      jsonElement - element
      Returns:
      object deserialized
    • deserializeItemFields

      public void deserializeItemFields()
      Go through and deserialize each json item into the deserializedItems. This can be overriden to provide custom deserialization.