Module Mal4J

Class LimitOffsetQuery<T extends LimitOffsetQuery<T,R>,R>

java.lang.Object
dev.katsute.mal4j.query.LimitOffsetQuery<T,R>
Type Parameters:
T - this
R - response
Direct Known Subclasses:
FieldQuery, ForumSearchQuery, ForumTopicDetailPostQuery

public abstract class LimitOffsetQuery<T extends LimitOffsetQuery<T,R>,R> extends Object
Represents a query with a limit and offset.
Since:
1.0.0
Version:
1.0.0
Author:
Katsute
  • Method Details

    • withLimit

      public final T withLimit(int limit)
      Sets maximum amount of listings to return.
      Parameters:
      limit - limit
      Returns:
      search query
      Since:
      1.0.0
    • withOffset

      public final T withOffset(int offset)
      Sets the offset.
      Parameters:
      offset - offset
      Returns:
      search query
      Since:
      1.0.0
    • search

      public abstract List<R> search()
      Runs the search query.
      Returns:
      search listings
      Since:
      1.0.0
    • searchAll

      public abstract PaginatedIterator<R> searchAll()
      Runs the search query and returns an iterable.
      Returns:
      search iterable
      Since:
      1.0.0