Class Filter

java.lang.Object
com.datastax.astra.client.model.Document
com.datastax.astra.client.model.Filter
All Implemented Interfaces:
Serializable, Map<String,Object>

public class Filter extends Document
Filter Builder.
See Also:
  • Constructor Details

    • Filter

      public Filter()
      Default constructor.
    • Filter

      public Filter(@NonNull @NonNull String fieldName, @NonNull @NonNull FilterOperator cond, @NonNull @NonNull Object value)
      Create a filter from a where clause.
      Parameters:
      fieldName - fieldName
      cond - condition
      value - object value
  • Method Details

    • where

      public FilterBuilder where(String fieldName)
      Work with arguments.
      Parameters:
      fieldName - current field name.
      Returns:
      builder for the filter
    • where

      public Filter where(String fieldName, FilterOperator cond, Object value)
      Build where clause with operator
      Parameters:
      fieldName - current field name
      cond - current condition
      value - value for the condition
      Returns:
      current
    • findById

      public static Filter findById(String id)
      Build a filter for find by id.
      Parameters:
      id - identifier
      Returns:
      filter
    • toString

      public String toString()
      Serialization with Jackson.
      Overrides:
      toString in class Document
      Returns:
      json string
    • toJson

      public String toJson()
      Express the json filter as a string.
      Overrides:
      toJson in class Document
      Returns:
      json expression