Interface Document.Field<T>

Type Parameters:
T - Type of field values
Enclosing interface:
Document

public static interface Document.Field<T>
Representation of single field in document. Fields can be multivalued
  • Method Details

    • getName

      String getName()
      Returns:
      the field name
    • getValues

      Collection<T> getValues()
      Returns:
      the field values
    • setValue

      Document.Field<T> setValue(Object value)
      Set new value for this field. This will override any previously existing values.
      Parameters:
      value - Value to set
      Returns:
      this field, with modified list of values
    • setValues

      Document.Field<T> setValues(Collection<?> values)
      Set new values for this field. This will override any previously existing values.
      Parameters:
      values - Collection of values to set
      Returns:
      this field, with a modified list of values
    • addValue

      Document.Field<T> addValue(Object value)
      Add a value to the field. This will not override any previously existing values.
      Parameters:
      value - Value to add
      Returns:
      this field, with a modified list of values
    • addValues

      Document.Field<T> addValues(Collection<?> values)
      Add more values to the field. This will not override any previously existing values.
      Parameters:
      values - Collection of values to add
      Returns:
      this field, with a modified list of values
    • map

      Apply mapping function to each field value.
      Parameters:
      mapper - Mapping function
      Returns:
      This field