Class TableIndexDescriptor<DEF extends TableIndexDefinition<?>>

java.lang.Object
com.datastax.astra.client.tables.definition.indexes.TableIndexDescriptor<DEF>
Type Parameters:
DEF - the type of index definition.
Direct Known Subclasses:
TableRegularIndexDescriptor, TableTextIndexDescriptor, TableVectorIndexDescriptor

public abstract class TableIndexDescriptor<DEF extends TableIndexDefinition<?>> extends Object
Represents a descriptor for a table index, including the table's name and associated index options.
  • Field Details

  • Constructor Details

    • TableIndexDescriptor

      protected TableIndexDescriptor(Function<DEF,? extends TableIndexDescriptor<DEF>> constructor)
      Constructor that accepts a function for instance creation.
      Parameters:
      constructor - the function to create a new instance of the subclass.
  • Method Details

    • mapImpl

      protected TableIndexDescriptor<DEF> mapImpl(Consumer<TableIndexDescriptor<DEF>> updater)
      Generic method to create a new instance with modified properties.
      Parameters:
      updater - Consumer function to modify the new instance.
      Returns:
      A new modified instance.
    • name

      public TableIndexDescriptor<DEF> name(String name)
      Sets the name of the table.
      Parameters:
      name - the name of the table.
      Returns:
      a new instance with the updated table name.
    • definition

      public TableIndexDescriptor<DEF> definition(DEF def)
      Sets the index definition for the table.
      Parameters:
      def - the TableIndexDefinition defining the index options for the table.
      Returns:
      a new instance with the updated definition.
    • toString

      public String toString()
      Converts the object to a string using the RowSerializer.
      Overrides:
      toString in class Object
      Returns:
      a string representation of this TableIndexDescriptor.