Class DocumentChecker
- java.lang.Object
-
- com.google.appengine.api.search.checkers.DocumentChecker
-
-
Constructor Summary
Constructors Constructor Description DocumentChecker()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringcheckDocumentId(String documentId)Checks whether a document id is valid.static voidcheckFacetSet(com.google.apphosting.api.search.DocumentPb.Document document)Checks validity of facets in document.static voidcheckFieldSet(com.google.apphosting.api.search.DocumentPb.Document document)Checks whether a document's field set is valid.static com.google.apphosting.api.search.DocumentPb.DocumentcheckValid(com.google.apphosting.api.search.DocumentPb.Document pb)Checks whether aDocumentPb.Documenthas a valid set of fields.static intgetNumberOfSecondsSince()
-
-
-
Method Detail
-
checkDocumentId
public static String checkDocumentId(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:
IllegalArgumentException- if the document id is invalid
-
checkFieldSet
public static void checkFieldSet(com.google.apphosting.api.search.DocumentPb.Document document)
Checks whether a document's field set is valid. A field set is valid if it does not contain any number, date, or vector fields with the same name.- Parameters:
document- the document to check- Throws:
IllegalArgumentException- if the document contains an invalid set of fields.
-
checkFacetSet
public static void checkFacetSet(com.google.apphosting.api.search.DocumentPb.Document document)
Checks validity of facets in document.
-
checkValid
public static com.google.apphosting.api.search.DocumentPb.Document checkValid(com.google.apphosting.api.search.DocumentPb.Document pb)
Checks whether aDocumentPb.Documenthas a valid set of fields.- Parameters:
pb- theDocumentPb.Documentprotocol buffer to check- Returns:
- the checked document
- Throws:
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
-
-