Class FieldDef<I,​T>

  • Type Parameters:
    I - input type from which documents are created and search results are returned.
    T - type that should be extracted from the input object when converting to an index document.

    public final class FieldDef<I,​T>
    extends Object
    Definition of a field stored in the secondary index.
    • Method Detail

      • getName

        public String getName()
        Returns name of the field.
      • getType

        public FieldType<?> getType()
        Returns type of the field; for repeatable fields, the inner type, not the iterable type.
      • isStored

        public boolean isStored()
        Returns whether the field should be stored in the index.
      • get

        public T get​(I input)
        Get the field contents from the input object.
        Parameters:
        input - input object.
        Returns:
        the field value(s) to index.
      • setIfPossible

        public boolean setIfPossible​(I object,
                                     StoredValue doc)
        Set the field contents back to an object. Used to reconstruct fields from indexed values. No-op if the field can't be reconstructed.
        Parameters:
        object - input object.
        doc - indexed document
        Returns:
        true if the field was set, false otherwise
      • isRepeatable

        public boolean isRepeatable()
        Returns whether the field is repeatable.