Class EmptyPageToken

java.lang.Object
tech.ydb.yoj.repository.db.list.token.EmptyPageToken
All Implemented Interfaces:
PageToken

public final class EmptyPageToken extends Object implements PageToken
The most trivial implementation of PageToken: it does not produce page tokens, and is thus only suitable when the listing produces at most one page of results.
  • Field Details

    • INSTANCE

      public static final PageToken INSTANCE
  • Constructor Details

    • EmptyPageToken

      public EmptyPageToken()
  • Method Details

    • encode

      @Nullable public <T, R> String encode(@NonNull @NonNull GenericListResult<T,R> result)
      Description copied from interface: PageToken
      Encodes information about next search result page.
      Specified by:
      encode in interface PageToken
      Type Parameters:
      T - search request type
      R - search result type
      Parameters:
      result - current search result page
      Returns:
      next page token or null if this is the last page of results
    • decode

      @NonNull public <T> ListRequest.Builder<T> decode(@NonNull ListRequest.Builder<T> bldr, @NonNull @NonNull String token) throws BadListingException.InvalidPageToken
      Description copied from interface: PageToken
      Decodes page token into listing request.
      This method must be called only once per page, because it changes the listing request builder's state and is therefore non-idempotent.
      Specified by:
      decode in interface PageToken
      Type Parameters:
      T - search request type
      Parameters:
      bldr - listing request builder
      token - page token
      Returns:
      listing request builder for to the page encoded by the token
      Throws:
      BadListingException.InvalidPageToken - page token is invalid