Class RedisCursor


  • public final class RedisCursor
    extends Object
    A cursor encapsulation for the result of a SCAN call.
    Author:
    Matthew Tropiano
    • Method Detail

      • create

        public static RedisCursor create​(long cursor,
                                         String[] keys)
        Creates a new scan cursor with a set of keys.
        Parameters:
        cursor - the cursor value to use for the next call.
        keys - the keys to use for this cursor.
        Returns:
        a new cursor.
      • getCursor

        public long getCursor()
        Returns:
        the value of the next cursor handle to use for retrieving later keys in the iteration.
      • getKeys

        public String[] getKeys()
        Returns:
        the keys to iterate through in this cursor iteration. May be empty.
      • hasNext

        public boolean hasNext()
        Checks if there are more keys to iterate through. If true, this cursor should be used again in order to complete a full iteration. Equivalent to getCursor() != 0.
        Returns:
        true if more keys exist, false if not.