Class FieldBundle

java.lang.Object
com.google.gerrit.index.query.FieldBundle

public class FieldBundle extends Object
FieldBundle is an abstraction that allows retrieval of raw values from different sources.
  • Constructor Details

    • FieldBundle

      public FieldBundle(com.google.common.collect.ListMultimap<String,Object> fields, boolean storesIndexedFields)
  • Method Details

    • getValue

      public <T> T getValue(SchemaFieldDefs.SchemaField<?,T> schemaField)
      Get a field's value based on the field definition.
      Type Parameters:
      T - Data type of the returned object based on the field definition
      Parameters:
      schemaField - the definition of the field of which the value should be retrieved. The field must be stored and contained in the result set as specified by QueryOptions.
      Returns:
      Either a single element or an Iterable based on the field definition. An empty list is returned for repeated fields that are not contained in the result.
      Throws:
      IllegalArgumentException - if the requested field is not stored or not present. This check is only enforced on non-repeatable fields.