Package com.google.gerrit.index.query
Class FieldBundle
java.lang.Object
com.google.gerrit.index.query.FieldBundle
FieldBundle is an abstraction that allows retrieval of raw values from different sources.
-
Constructor Summary
ConstructorsConstructorDescriptionFieldBundle
(com.google.common.collect.ListMultimap<String, Object> fields, boolean storesIndexedFields) -
Method Summary
Modifier and TypeMethodDescription<T> T
getValue
(SchemaFieldDefs.SchemaField<?, T> schemaField) Get a field's value based on the field definition.
-
Constructor Details
-
FieldBundle
-
-
Method Details
-
getValue
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 byQueryOptions
.- 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.
-