Interface CursorEncoder


public interface CursorEncoder
Strategy to encode and decode a String cursor to make it opaque for clients. Typically applied to a CursorStrategy via CursorStrategy.withEncoder(CursorStrategy, CursorEncoder).
Since:
1.2.0
Author:
Rossen Stoyanchev
  • Method Summary

    Modifier and Type
    Method
    Description
    Return a CursorEncoder for Base64 encoding and decoding.
    decode(String cursor)
    Decode the given cursor from external input.
    encode(String cursor)
    Encode the given cursor value for external use.
    Return a CursorEncoder that does not encode nor decode.
  • Method Details

    • encode

      String encode(String cursor)
      Encode the given cursor value for external use.
      Parameters:
      cursor - the cursor to encode
      Returns:
      the encoded value
    • decode

      String decode(String cursor)
      Decode the given cursor from external input.
      Parameters:
      cursor - the raw cursor to decode
      Returns:
      the decoded value
    • base64

      static CursorEncoder base64()
      Return a CursorEncoder for Base64 encoding and decoding.
    • noOpEncoder

      static CursorEncoder noOpEncoder()
      Return a CursorEncoder that does not encode nor decode.