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
Type Description
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
Name Description
atom String

the indivisible text of the field

Returns
Type Description
Field.Builder

this builder

setDate(Date date)

public Field.Builder setDate(Date date)

Sets a date associated with the field.

Parameter
Name Description
date Date

the date of the field

Returns
Type Description
Field.Builder

this builder

setGeoPoint(GeoPoint geoPoint)

public Field.Builder setGeoPoint(GeoPoint geoPoint)

Sets a GeoPoint value for the field.

Parameter
Name Description
geoPoint GeoPoint

the GeoPoint value of the field

Returns
Type Description
Field.Builder

this builder

setHTML(String html)

public Field.Builder setHTML(String html)

Sets a HTML value for the field.

Parameter
Name Description
html String

the HTML value of the field

Returns
Type Description
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
Name Description
locale Locale

the locale the field value is written in

Returns
Type Description
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
Name Description
name String

the name of the field

Returns
Type Description
Field.Builder

this builder

setNumber(double number)

public Field.Builder setNumber(double number)
Parameter
Name Description
number double

the numeric value of the field

Returns
Type Description
Field.Builder

this builder

setText(String text)

public Field.Builder setText(String text)

Sets a text value for the field.

Parameter
Name Description
text String

the text value of the field

Returns
Type Description
Field.Builder

this builder

setTokenizedPrefix(String tokenizedPrefix)

public Field.Builder setTokenizedPrefix(String tokenizedPrefix)

Sets a tokenized prefix value for the field.

Parameter
Name Description
tokenizedPrefix String

the string value of the field

Returns
Type Description
Field.Builder

this builder

setUntokenizedPrefix(String untokenizedPrefix)

public Field.Builder setUntokenizedPrefix(String untokenizedPrefix)

Sets an untokenized prefix value for the field.

Parameter
Name Description
untokenizedPrefix String

the string value of the field

Returns
Type Description
Field.Builder

this builder

setVector(List<Double> vector)

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

Sets a vector value for the field.

Parameter
Name Description
vector List<Double>

a list of Double values forming a vector field value

Returns
Type Description
Field.Builder

this builder