Class Paging.Builder<T>

java.lang.Object
se.michaelthelin.spotify.model_objects.AbstractModelObject.Builder
se.michaelthelin.spotify.model_objects.specification.Paging.Builder<T>
Type Parameters:
T - The type of the objects contained in a paging object.
All Implemented Interfaces:
IModelObject.Builder
Enclosing class:
Paging<T>

public static final class Paging.Builder<T> extends AbstractModelObject.Builder
Builder class for building Paging instances.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • setHref

      public Paging.Builder<T> setHref(String href)
      The href setter.
      Parameters:
      href - A link to the Web API endpoint returning the full result of the request.
      Returns:
      A Paging.Builder.
    • setItems

      public Paging.Builder<T> setItems(T[] items)
      The items setter.
      Parameters:
      items - A page of items.
      Returns:
      A Paging.Builder.
    • setLimit

      public Paging.Builder<T> setLimit(Integer limit)
      The request limit setter.
      Parameters:
      limit - The maximum number of items in the response (as set in the query or by default).
      Returns:
      A Paging.Builder.
    • setNext

      public Paging.Builder<T> setNext(String next)
      The next URL setter.
      Parameters:
      next - URL to the next page of items. (null if none)
      Returns:
      A Paging.Builder.
    • setOffset

      public Paging.Builder<T> setOffset(Integer offset)
      The offset setter.
      Parameters:
      offset - The offset of the items returned (as set in the query or by default).
      Returns:
      A Paging.Builder.
    • setPrevious

      public Paging.Builder<T> setPrevious(String previous)
      The previous URL setter.
      Parameters:
      previous - URL to the previous page of items. (null if none)
      Returns:
      A Paging.Builder.
    • setTotal

      public Paging.Builder<T> setTotal(Integer total)
      The total amount setter.
      Parameters:
      total - The total number of items available to return.
      Returns:
      A Paging.Builder.
    • build

      public Paging<T> build()
      Description copied from interface: IModelObject.Builder
      Build a model object with the information set in the builder object.
      The type of the model object and its methods depend on its corresponding implementation.
      Returns:
      A model object.