Class Field.Builder (2.0.0)

public static final class Field.Builder

A field builder. Fields must have a name, and optionally a locale and at most one of text, html, atom or date.

Inheritance

java.lang.Object > Field.Builder

Methods

build()

public Field build()

Builds a field using this builder. The field must have a valid name, string value, type.

Returns
TypeDescription
Field

a Field built by this builder

setAtom(String atom)

public Field.Builder setAtom(String atom)

Sets an atomic value, indivisible text, for the field.

Parameter
NameDescription
atomString

the indivisible text of the field

Returns
TypeDescription
Field.Builder

this builder

setDate(Date date)

public Field.Builder setDate(Date date)

Sets a date associated with the field.

Parameter
NameDescription
dateDate

the date of the field

Returns
TypeDescription
Field.Builder

this builder

setGeoPoint(GeoPoint geoPoint)

public Field.Builder setGeoPoint(GeoPoint geoPoint)

Sets a GeoPoint value for the field.

Parameter
NameDescription
geoPointGeoPoint

the GeoPoint value of the field

Returns
TypeDescription
Field.Builder

this builder

setHTML(String html)

public Field.Builder setHTML(String html)

Sets a HTML value for the field.

Parameter
NameDescription
htmlString

the HTML value of the field

Returns
TypeDescription
Field.Builder

this builder

setLocale(Locale locale)

public Field.Builder setLocale(Locale locale)

Sets the Locale of the field value. If none is given, then the locale of the document will be used.

Parameter
NameDescription
localeLocale

the locale the field value is written in

Returns
TypeDescription
Field.Builder

this builder

setName(String name)

public Field.Builder setName(String name)

Sets a name for the field. The field name length must be between 1 and FieldChecker#MAXIMUM_NAME_LENGTH and it should match com.google.appengine.api.search.checkers.SearchApiLimits#FIELD_NAME_PATTERN.

Parameter
NameDescription
nameString

the name of the field

Returns
TypeDescription
Field.Builder

this builder

setNumber(double number)

public Field.Builder setNumber(double number)
Parameter
NameDescription
numberdouble

the numeric value of the field

Returns
TypeDescription
Field.Builder

this builder

setText(String text)

public Field.Builder setText(String text)

Sets a text value for the field.

Parameter
NameDescription
textString

the text value of the field

Returns
TypeDescription
Field.Builder

this builder

setTokenizedPrefix(String tokenizedPrefix)

public Field.Builder setTokenizedPrefix(String tokenizedPrefix)

Sets a tokenized prefix value for the field.

Parameter
NameDescription
tokenizedPrefixString

the string value of the field

Returns
TypeDescription
Field.Builder

this builder

setUntokenizedPrefix(String untokenizedPrefix)

public Field.Builder setUntokenizedPrefix(String untokenizedPrefix)

Sets an untokenized prefix value for the field.

Parameter
NameDescription
untokenizedPrefixString

the string value of the field

Returns
TypeDescription
Field.Builder

this builder

setVector(List<Double> vector)

public Field.Builder setVector(List<Double> vector)

Sets a vector value for the field.

Parameter
NameDescription
vectorList<Double>

a list of Double values forming a vector field value

Returns
TypeDescription
Field.Builder

this builder