Enum Class CursorState

java.lang.Object
java.lang.Enum<CursorState>
com.datastax.astra.client.core.paging.CursorState
All Implemented Interfaces:
Serializable, Comparable<CursorState>, Constable

public enum CursorState extends Enum<CursorState>
Represents the possible states of a database cursor.

A cursor can be in one of the following states:

  • IDLE - The cursor is created but not yet started.
  • STARTED - The cursor has been started and is active.
  • CLOSED - The cursor has been closed and is no longer usable.

Example usage:


 CursorState state = CursorState.IDLE;

 switch (state) {
     case IDLE:
         System.out.println("The cursor is idle.");
         break;
     case STARTED:
         System.out.println("The cursor is active.");
         break;
     case CLOSED:
         System.out.println("The cursor is closed.");
         break;
 }
 
  • Enum Constant Details

    • IDLE

      public static final CursorState IDLE
      Indicates that the cursor is created but not yet started.
    • STARTED

      public static final CursorState STARTED
      Indicates that the cursor has been started and is active.
    • CLOSED

      public static final CursorState CLOSED
      Indicates that the cursor has been closed and is no longer usable.
  • Method Details

    • values

      public static CursorState[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static CursorState valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null