Class TableIndexDefinition<OPTIONS>

java.lang.Object
com.datastax.astra.client.tables.definition.indexes.TableIndexDefinition<OPTIONS>
Type Parameters:
OPTIONS - the type of options (vector, normal) for index definition.
Direct Known Subclasses:
TableRegularIndexDefinition, TableTextIndexDefinition, TableVectorIndexDefinition

public abstract class TableIndexDefinition<OPTIONS> extends Object
Represents the base class for table index definitions, encapsulating common properties and behaviors for index definitions, including the column being indexed and API support for index-related operations.

Subclasses should extend this abstract class to implement specific types of index definitions.

  • Field Details

  • Constructor Details

    • TableIndexDefinition

      protected TableIndexDefinition(Function<OPTIONS,? extends TableIndexDefinition<OPTIONS>> constructor)
      Constructs a new instance of TableIndexDefinition with the specified constructor function.
      Parameters:
      constructor - the constructor function for creating new instances of the subclass.
  • Method Details

    • mapImpl

      Maps the current instance to a new instance with updated properties.
      Parameters:
      updater - a consumer function that updates the properties of the new instance.
      Returns:
      a new instance with the updated properties.
    • column

      public TableIndexDefinition<OPTIONS> column(String column)
      Sets the name of the column for the index.
      Parameters:
      column - the name of the column to be indexed.
      Returns:
      a new instance with the updated column.
    • column

      public TableIndexDefinition<OPTIONS> column(String column, TableIndexMapTypes type)
      Sets the name of the column for the index.
      Parameters:
      column - the name of the column to be indexed.
      type - the type of the column to be indexed.
      Returns:
      the current instance of TableIndexDefinition for method chaining.
    • options

      public TableIndexDefinition<OPTIONS> options(OPTIONS options)
      Sets the options for configuring the table index.
      Parameters:
      options - an instance of TableIndexDefinitionOptions containing index options.
      Returns:
      the current instance of TableIndexDefinition for method chaining.