com.google.appengine.api.search.checkers

## Class DocumentChecker

- java.lang.Object
- - com.google.appengine.api.search.checkers.DocumentChecker

-     public final class DocumentChecker
      extends java.lang.Object

  Checks values of a `Document`.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DocumentChecker()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.lang.String` | `checkDocumentId(java.lang.String documentId)` Checks whether a document id is valid.
    `static void` | `checkFieldSet(DocumentPb.Document document)` Checks whether a document's field set is valid.
    `static DocumentPb.Document` | `checkValid(DocumentPb.Document pb)` Checks whether a `DocumentPb.Document` has a valid set of fields.
    `static int` | `getNumberOfSecondsSince()`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DocumentChecker

          public DocumentChecker()

  - ### Method Detail

    - #### checkDocumentId

          public static java.lang.String checkDocumentId(java.lang.String documentId)

      Checks whether a document id is valid. A document id is a non-null ASCII visible printable string of #MAXIMUM_DOCUMENT_ID_LENGTH characters which does not start with '!' which is reserved for system documents.
      Parameters:
        `documentId` - the document id to check
      Returns:
        the checked document id
      Throws:
        `java.lang.IllegalArgumentException` - if the document id is invalid

    - #### checkFieldSet

          public static void checkFieldSet(DocumentPb.Document document)

      Checks whether a document's field set is valid. A field set is valid if it does not contain any number or date fields with the same name.
      Parameters:
        `document` - the document to check
      Throws:
        `java.lang.IllegalArgumentException` - if the document contains an invalid set of fields.

    - #### checkValid

          public static DocumentPb.Document checkValid(DocumentPb.Document pb)

      Checks whether a `DocumentPb.Document` has a valid set of fields.
      Parameters:
        `pb` - the `DocumentPb.Document` protocol buffer to check
      Returns:
        the checked document
      Throws:
        `java.lang.IllegalArgumentException` - if some field is invalid such as document id or fields

    - #### getNumberOfSecondsSince

          public static int getNumberOfSecondsSince()

      Returns:
        the number of seconds since 2011/1/1