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.
    All Implemented Interfaces:
    SchemaFieldDefs.SchemaField<I,​T>

    public final class FieldDef<I,​T>
    extends Object
    implements SchemaFieldDefs.SchemaField<I,​T>
    Definition of a field stored in the secondary index.

    FieldDef-s must not be changed once introduced to the codebase. Instead, a new FieldDef must be added and the old one removed from the schema (in two upgrade steps, see com.google.gerrit.index.IndexUpgradeValidator).

    Note that FieldDef does not override Object.equals(Object). It relies on instances being singletons so that the default (i.e. reference) comparison works.