Package kong.unirest

Class PagedList<T>

    • Constructor Detail

      • PagedList

        public PagedList()
    • Method Detail

      • getBodies

        public List<T> getBodies()
        Returns:
        Returns all successful bodies
      • ifSuccess

        public PagedList<T> ifSuccess​(Consumer<HttpResponse<T>> consumer)
        For each successful response If the response was a 200-series response. Invoke this consumer can be chained with ifFailure
        Parameters:
        consumer - a function to consume a HttpResponse
        Returns:
        the same paged list
      • ifFailure

        public PagedList<T> ifFailure​(Consumer<HttpResponse<T>> consumer)
        For each failed response if the response was NOT a 200-series response or a mapping exception happened. Invoke this consumer can be chained with ifSuccess
        Parameters:
        consumer - a function to consume a HttpResponse
        Returns:
        the same paged list