Package com.google.gerrit.index
Class FieldDef<I,T>
- java.lang.Object
-
- com.google.gerrit.index.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FieldDef.Builder<T>
static interface
FieldDef.Getter<I,T>
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FieldDef.Builder<String>
exact(String name)
static FieldDef.Builder<String>
fullText(String name)
T
get(I input)
Get the field contents from the input object.String
getName()
FieldType<?>
getType()
static FieldDef.Builder<Integer>
integer(String name)
static FieldDef.Builder<Integer>
intRange(String name)
boolean
isRepeatable()
boolean
isStored()
static FieldDef.Builder<String>
prefix(String name)
static FieldDef.Builder<byte[]>
storedOnly(String name)
static FieldDef.Builder<Timestamp>
timestamp(String name)
-
-
-
Method Detail
-
exact
public static FieldDef.Builder<String> exact(String name)
-
fullText
public static FieldDef.Builder<String> fullText(String name)
-
intRange
public static FieldDef.Builder<Integer> intRange(String name)
-
integer
public static FieldDef.Builder<Integer> integer(String name)
-
prefix
public static FieldDef.Builder<String> prefix(String name)
-
storedOnly
public static FieldDef.Builder<byte[]> storedOnly(String name)
-
timestamp
public static FieldDef.Builder<Timestamp> timestamp(String name)
-
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.
-
isRepeatable
public boolean isRepeatable()
- Returns:
- whether the field is repeatable.
-
-