Interface Document


public interface Document
A document in the query QueryResponse. Documents in the query's result set may be accessed by calling QueryRequestResponse.getQueryResponse().QueryResponse.getDocuments()
  • Method Details

    • getNumberOfFields

      int getNumberOfFields()
      Returns:
      the number of fields in the document.
    • getFields

      Set<Document.Field<Object>> getFields()
      Returns:
      a set of fields in the document.
    • containsField

      boolean containsField(String field)
      Whether the document contains the given field.
      Parameters:
      field - the name of the field
      Returns:
      true if the document contains the given field
    • getField

      Optional<Document.Field<Object>> getField(String field)
      Retrieve from the document the given field.
      Parameters:
      field - the name of the field to retrieve
      Returns:
      the retrieved field if present, otherwise an empty Optional
    • setField

      Document.Field<Object> setField(String field, Object value)
      Set the given field with the given value on the document. This will override any previously existing field on the the document that had the same name.
      Parameters:
      field - the name of the field
      value - the value of the field
      Returns:
      the previously set field if any, otherwise null
    • removeField

      void removeField(String field)
      Remove the given field from the document.
      Parameters:
      field - the name of the field.