# Class FacetChecker (5.0.3)

    public final class FacetChecker

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

## Inheritance

[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> FacetChecker

## Inherited Members

[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) [Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) [Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) [Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) [Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) [Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) [Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) [Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) [Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) [Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) [Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)

## 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` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` the atom value to check |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | 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](https://docs.cloud.google.com/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.search.checkers.SearchApiLimits#com_google_appengine_api_search_checkers_SearchApiLimits_MAXIMUM_NAME_LENGTH) inclusive, and it should match
[SearchApiLimits#FIELD_NAME_PATTERN](https://docs.cloud.google.com/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.search.checkers.SearchApiLimits#com_google_appengine_api_search_checkers_SearchApiLimits_FIELD_NAME_PATTERN).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` the facet name to check |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | 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](https://docs.cloud.google.com/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.search.checkers.SearchApiLimits#com_google_appengine_api_search_checkers_SearchApiLimits_MAXIMUM_NAME_LENGTH) inclusive, and it should match
[SearchApiLimits#FIELD_NAME_PATTERN](https://docs.cloud.google.com/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.search.checkers.SearchApiLimits#com_google_appengine_api_search_checkers_SearchApiLimits_FIELD_NAME_PATTERN).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` the facet name to check |
| `callerContext` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` the caller context used for creating error message in case of a failure. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | 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](https://docs.cloud.google.com/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.search.checkers.SearchApiLimits#com_google_appengine_api_search_checkers_SearchApiLimits_MINIMUM_NUMBER_VALUE) and [SearchApiLimits#MAXIMUM_NUMBER_VALUE](https://docs.cloud.google.com/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.search.checkers.SearchApiLimits#com_google_appengine_api_search_checkers_SearchApiLimits_MAXIMUM_NUMBER_VALUE),
inclusive.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://docs.oracle.com/javase/8/docs/api/java/lang/Double.html` the value to check |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/Double.html` | 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` |   |