java.lang.Object
org.apache.sling.graphql.api.pagination.Cursor

@ProviderType public class Cursor extends Object
This class provides a Base64-encoded cursor which is used for paginated results, according to the specification from https://relay.dev/graphql/connections.htm#sec-Cursor.
  • Constructor Details

    • Cursor

      public Cursor(@NotNull @NotNull String rawValue)
      Creates a cursor from a String. The passed rawValue should not be null, nor an empty String.
      Parameters:
      rawValue - the raw value from which to generate a cursor
  • Method Details

    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • fromEncodedString

      @Nullable public static @Nullable Cursor fromEncodedString(@Nullable @Nullable String encoded)
      Generates a new cursor based on an encoded value obtained via the same encoding mechanism this class uses.
      Parameters:
      encoded - the encoded value from which to generate a new cursor
      Returns:
      a new cursor, if one can be generated; null otherwise
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getRawValue

      @NotNull public @NotNull String getRawValue()
    • getEncoded

      @NotNull public @NotNull String getEncoded()