Package com.google.gerrit.index.query
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 Summary
Constructors Constructor Description FieldBundle(com.google.common.collect.ListMultimap<String,Object> fields)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> T
getValue(FieldDef<?,T> fieldDef)
Get a field's value based on the field definition.
-
-
-
Method Detail
-
getValue
public <T> T getValue(FieldDef<?,T> fieldDef)
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:
fieldDef
- 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.
-
-