Field.Builder (Google App Engine API for Java)

com.google.appengine.api.search

Class Field.Builder

  • java.lang.Object
    • com.google.appengine.api.search.Field.Builder
  • Enclosing class:
    Field


    public static final class Field.Builder
    extends java.lang.Object
    A field builder. Fields must have a name, and optionally a locale and at most one of text, html, atom or date.
    • Method Detail

      • setName

        public Field.Builder setName(java.lang.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 SearchApiLimits.FIELD_NAME_PATTERN.
        Parameters:
        name - the name of the field
        Returns:
        this builder
        Throws:
        java.lang.IllegalArgumentException - if the name or value is invalid
      • setText

        public Field.Builder setText(java.lang.String text)
        Sets a text value for the field.
        Parameters:
        text - the text value of the field
        Returns:
        this builder
        Throws:
        java.lang.IllegalArgumentException - if the text is invalid
      • setHTML

        public Field.Builder setHTML(java.lang.String html)
        Sets a HTML value for the field.
        Parameters:
        html - the HTML value of the field
        Returns:
        this builder
        Throws:
        java.lang.IllegalArgumentException - if the HTML is invalid
      • setAtom

        public Field.Builder setAtom(java.lang.String atom)
        Sets an atomic value, indivisible text, for the field.
        Parameters:
        atom - the indivisible text of the field
        Returns:
        this builder
        Throws:
        java.lang.IllegalArgumentException - if the atom is invalid
      • setDate

        public Field.Builder setDate(java.util.Date date)
        Sets a date associated with the field.
        Parameters:
        date - the date of the field
        Returns:
        this builder
        Throws:
        java.lang.IllegalArgumentException - if the date is out of range