Class FacetChecker (2.0.0)

public final class FacetChecker

Provides checks for Facet names and values: atom or number.

Inheritance

java.lang.Object > FacetChecker

Static Methods

checkAtom(String value)

public static String checkAtom(String value)

Checks whether an atom is valid. An atom can be null or a string between 1 and SearchApiLimits.MAXIMUM_ATOM_LENGTH in length, inclusive.

Parameter
Name Description
value String

the atom value to check

Returns
Type Description
String

the checked atom

checkFacetName(String name)

public static String checkFacetName(String name)

Checks whether a facet name is valid. The facet name length must be between 1 and SearchApiLimits#MAXIMUM_NAME_LENGTH inclusive, and it should match SearchApiLimits#FIELD_NAME_PATTERN.

Parameter
Name Description
name String

the facet name to check

Returns
Type Description
String

the checked facet name

checkFacetName(String name, String callerContext)

public static String checkFacetName(String name, String callerContext)

Checks whether a facet name is valid. The facet name length must be between 1 and SearchApiLimits#MAXIMUM_NAME_LENGTH inclusive, and it should match SearchApiLimits#FIELD_NAME_PATTERN.

Parameters
Name Description
name String

the facet name to check

callerContext String

the caller context used for creating error message in case of a failure.

Returns
Type Description
String

the checked facet name

checkFacetValue(DocumentPb.FacetValue value)

public static DocumentPb.FacetValue checkFacetValue(DocumentPb.FacetValue value)

Checks whether a facet value is valid.

Parameter
Name Description
value com.google.apphosting.api.search.DocumentPb.FacetValue

the facet value to check

Returns
Type Description
com.google.apphosting.api.search.DocumentPb.FacetValue

the checked facet value

checkNumber(Double value)

public static Double checkNumber(Double value)

Checks whether a number is valid. A number can be null or a value between SearchApiLimits#MINIMUM_NUMBER_VALUE and SearchApiLimits#MAXIMUM_NUMBER_VALUE, inclusive.

Parameter
Name Description
value Double

the value to check

Returns
Type Description
Double

the checked number

checkValid(DocumentPb.Facet facet)

public static DocumentPb.Facet checkValid(DocumentPb.Facet facet)
Parameter
Name Description
facet com.google.apphosting.api.search.DocumentPb.Facet
Returns
Type Description
com.google.apphosting.api.search.DocumentPb.Facet