Class TableIndexDefinition

java.lang.Object
com.datastax.astra.client.tables.definition.indexes.TableBaseIndexDefinition
com.datastax.astra.client.tables.definition.indexes.TableIndexDefinition

public class TableIndexDefinition extends TableBaseIndexDefinition
Represents a definition for table indices, allowing customization of various indexing options. This class provides a fluent interface to configure column names and index properties such as ASCII encoding, normalization, and case sensitivity.

Example usage:

 
 TableIndexDefinition indexDefinition = new TableIndexDefinition()
     .column("username")
     .ascii(true)
     .normalize(false)
     .caseSensitive(true);
 
 
  • Constructor Details

    • TableIndexDefinition

      public TableIndexDefinition()
      Default constructor.
  • Method Details

    • column

      public TableIndexDefinition column(String column)
      Sets the name of the column for the index.
      Parameters:
      column - the name of the column to be indexed.
      Returns:
      the current instance of TableIndexDefinition for method chaining.
    • 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.
    • ascii

      public TableIndexDefinition ascii(boolean ascii)
      Enables or disables ASCII encoding for the index.
      Parameters:
      ascii - true to enable ASCII encoding, false otherwise.
      Returns:
      the current instance of TableIndexDefinition for method chaining.
    • normalize

      public TableIndexDefinition normalize(boolean normalize)
      Enables or disables normalization for the index.
      Parameters:
      normalize - true to enable normalization, false otherwise.
      Returns:
      the current instance of TableIndexDefinition for method chaining.
    • caseSensitive

      public TableIndexDefinition caseSensitive(boolean caseSensitive)
      Sets whether the index should be case-sensitive.
      Parameters:
      caseSensitive - true if the index should be case-sensitive, false otherwise.
      Returns:
      the current instance of TableIndexDefinition for method chaining.