Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License").
   * You may not use this file except in compliance with the License.
   * A copy of the License is located at
   * 
   *  http://aws.amazon.com/apache2.0
   * 
  * or in the "license" file accompanying this file. This file is distributed
  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  * express or implied. See the License for the specific language governing
  * permissions and limitations under the License.
  */
 package com.amazonaws.services.cloudsearchv2.model;
 

Options for text field. Present if IndexFieldType specifies the field is of type text . A text field is always searchable. All options are enabled by default.

 
 public class TextOptions implements SerializableCloneable {

    
A value to use for the field if the field isn't specified for a document.

Constraints:
Length: 0 - 1024

 
     private String defaultValue;

    
A string that represents the name of an index field. CloudSearch supports regular index fields as well as dynamic fields. A dynamic field's name defines a pattern that begins or ends with a wildcard. Any document fields that don't map to a regular index field but do match a dynamic field's pattern are configured with the dynamic field's indexing options.

Regular field names begin with a letter and can contain the following characters: a-z (lowercase), 0-9, and _ (underscore). Dynamic field names must begin or end with a wildcard (*). The wildcard can also be the only character in a dynamic field name. Multiple wildcards, and wildcards embedded within a string are not supported.

The name score is reserved and cannot be used as a field name. To reference a document's ID, you can use the name _id.

Constraints:
Length: 1 - 64
Pattern: [a-z][a-z0-9_]*

 
     private String sourceField;

    
Whether the contents of the field can be returned in the search results.
 
     private Boolean returnEnabled;

    
Whether the field can be used to sort the search results.
 
     private Boolean sortEnabled;

    
Whether highlights can be returned for the field.
 
     private Boolean highlightEnabled;

    
The name of an analysis scheme for a text field.

Constraints:
Pattern: [\S]+

 
     private String analysisScheme;

    
A value to use for the field if the field isn't specified for a document.

Constraints:
Length: 0 - 1024

Returns:
A value to use for the field if the field isn't specified for a document.
 
     public String getDefaultValue() {
         return ;
     }
    
    
A value to use for the field if the field isn't specified for a document.

Constraints:
Length: 0 - 1024

Parameters:
defaultValue A value to use for the field if the field isn't specified for a document.
    public void setDefaultValue(String defaultValue) {
        this. = defaultValue;
    }
    
    
A value to use for the field if the field isn't specified for a document.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 0 - 1024

Parameters:
defaultValue A value to use for the field if the field isn't specified for a document.
Returns:
A reference to this updated object so that method calls can be chained together.
    public TextOptions withDefaultValue(String defaultValue) {
        this. = defaultValue;
        return this;
    }

    
A string that represents the name of an index field. CloudSearch supports regular index fields as well as dynamic fields. A dynamic field's name defines a pattern that begins or ends with a wildcard. Any document fields that don't map to a regular index field but do match a dynamic field's pattern are configured with the dynamic field's indexing options.

Regular field names begin with a letter and can contain the following characters: a-z (lowercase), 0-9, and _ (underscore). Dynamic field names must begin or end with a wildcard (*). The wildcard can also be the only character in a dynamic field name. Multiple wildcards, and wildcards embedded within a string are not supported.

The name score is reserved and cannot be used as a field name. To reference a document's ID, you can use the name _id.

Constraints:
Length: 1 - 64
Pattern: [a-z][a-z0-9_]*

Returns:
A string that represents the name of an index field. CloudSearch supports regular index fields as well as dynamic fields. A dynamic field's name defines a pattern that begins or ends with a wildcard. Any document fields that don't map to a regular index field but do match a dynamic field's pattern are configured with the dynamic field's indexing options.

Regular field names begin with a letter and can contain the following characters: a-z (lowercase), 0-9, and _ (underscore). Dynamic field names must begin or end with a wildcard (*). The wildcard can also be the only character in a dynamic field name. Multiple wildcards, and wildcards embedded within a string are not supported.

The name score is reserved and cannot be used as a field name. To reference a document's ID, you can use the name _id.

    public String getSourceField() {
        return ;
    }
    
    
A string that represents the name of an index field. CloudSearch supports regular index fields as well as dynamic fields. A dynamic field's name defines a pattern that begins or ends with a wildcard. Any document fields that don't map to a regular index field but do match a dynamic field's pattern are configured with the dynamic field's indexing options.

Regular field names begin with a letter and can contain the following characters: a-z (lowercase), 0-9, and _ (underscore). Dynamic field names must begin or end with a wildcard (*). The wildcard can also be the only character in a dynamic field name. Multiple wildcards, and wildcards embedded within a string are not supported.

The name score is reserved and cannot be used as a field name. To reference a document's ID, you can use the name _id.

Constraints:
Length: 1 - 64
Pattern: [a-z][a-z0-9_]*

Parameters:
sourceField A string that represents the name of an index field. CloudSearch supports regular index fields as well as dynamic fields. A dynamic field's name defines a pattern that begins or ends with a wildcard. Any document fields that don't map to a regular index field but do match a dynamic field's pattern are configured with the dynamic field's indexing options.

Regular field names begin with a letter and can contain the following characters: a-z (lowercase), 0-9, and _ (underscore). Dynamic field names must begin or end with a wildcard (*). The wildcard can also be the only character in a dynamic field name. Multiple wildcards, and wildcards embedded within a string are not supported.

The name score is reserved and cannot be used as a field name. To reference a document's ID, you can use the name _id.

    public void setSourceField(String sourceField) {
        this. = sourceField;
    }
    
    
A string that represents the name of an index field. CloudSearch supports regular index fields as well as dynamic fields. A dynamic field's name defines a pattern that begins or ends with a wildcard. Any document fields that don't map to a regular index field but do match a dynamic field's pattern are configured with the dynamic field's indexing options.

Regular field names begin with a letter and can contain the following characters: a-z (lowercase), 0-9, and _ (underscore). Dynamic field names must begin or end with a wildcard (*). The wildcard can also be the only character in a dynamic field name. Multiple wildcards, and wildcards embedded within a string are not supported.

The name score is reserved and cannot be used as a field name. To reference a document's ID, you can use the name _id.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 1 - 64
Pattern: [a-z][a-z0-9_]*

Parameters:
sourceField A string that represents the name of an index field. CloudSearch supports regular index fields as well as dynamic fields. A dynamic field's name defines a pattern that begins or ends with a wildcard. Any document fields that don't map to a regular index field but do match a dynamic field's pattern are configured with the dynamic field's indexing options.

Regular field names begin with a letter and can contain the following characters: a-z (lowercase), 0-9, and _ (underscore). Dynamic field names must begin or end with a wildcard (*). The wildcard can also be the only character in a dynamic field name. Multiple wildcards, and wildcards embedded within a string are not supported.

The name score is reserved and cannot be used as a field name. To reference a document's ID, you can use the name _id.

Returns:
A reference to this updated object so that method calls can be chained together.
    public TextOptions withSourceField(String sourceField) {
        this. = sourceField;
        return this;
    }

    
Whether the contents of the field can be returned in the search results.

Returns:
Whether the contents of the field can be returned in the search results.
    public Boolean isReturnEnabled() {
        return ;
    }
    
    
Whether the contents of the field can be returned in the search results.

Parameters:
returnEnabled Whether the contents of the field can be returned in the search results.
    public void setReturnEnabled(Boolean returnEnabled) {
        this. = returnEnabled;
    }
    
    
Whether the contents of the field can be returned in the search results.

Returns a reference to this object so that method calls can be chained together.

Parameters:
returnEnabled Whether the contents of the field can be returned in the search results.
Returns:
A reference to this updated object so that method calls can be chained together.
    public TextOptions withReturnEnabled(Boolean returnEnabled) {
        this. = returnEnabled;
        return this;
    }

    
Whether the contents of the field can be returned in the search results.

Returns:
Whether the contents of the field can be returned in the search results.
    public Boolean getReturnEnabled() {
        return ;
    }

    
Whether the field can be used to sort the search results.

Returns:
Whether the field can be used to sort the search results.
    public Boolean isSortEnabled() {
        return ;
    }
    
    
Whether the field can be used to sort the search results.

Parameters:
sortEnabled Whether the field can be used to sort the search results.
    public void setSortEnabled(Boolean sortEnabled) {
        this. = sortEnabled;
    }
    
    
Whether the field can be used to sort the search results.

Returns a reference to this object so that method calls can be chained together.

Parameters:
sortEnabled Whether the field can be used to sort the search results.
Returns:
A reference to this updated object so that method calls can be chained together.
    public TextOptions withSortEnabled(Boolean sortEnabled) {
        this. = sortEnabled;
        return this;
    }

    
Whether the field can be used to sort the search results.

Returns:
Whether the field can be used to sort the search results.
    public Boolean getSortEnabled() {
        return ;
    }

    
Whether highlights can be returned for the field.

Returns:
Whether highlights can be returned for the field.
    public Boolean isHighlightEnabled() {
        return ;
    }
    
    
Whether highlights can be returned for the field.

Parameters:
highlightEnabled Whether highlights can be returned for the field.
    public void setHighlightEnabled(Boolean highlightEnabled) {
        this. = highlightEnabled;
    }
    
    
Whether highlights can be returned for the field.

Returns a reference to this object so that method calls can be chained together.

Parameters:
highlightEnabled Whether highlights can be returned for the field.
Returns:
A reference to this updated object so that method calls can be chained together.
    public TextOptions withHighlightEnabled(Boolean highlightEnabled) {
        this. = highlightEnabled;
        return this;
    }

    
Whether highlights can be returned for the field.

Returns:
Whether highlights can be returned for the field.
    public Boolean getHighlightEnabled() {
        return ;
    }

    
The name of an analysis scheme for a text field.

Constraints:
Pattern: [\S]+

Returns:
The name of an analysis scheme for a text field.
    public String getAnalysisScheme() {
        return ;
    }
    
    
The name of an analysis scheme for a text field.

Constraints:
Pattern: [\S]+

Parameters:
analysisScheme The name of an analysis scheme for a text field.
    public void setAnalysisScheme(String analysisScheme) {
        this. = analysisScheme;
    }
    
    
The name of an analysis scheme for a text field.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Pattern: [\S]+

Parameters:
analysisScheme The name of an analysis scheme for a text field.
Returns:
A reference to this updated object so that method calls can be chained together.
    public TextOptions withAnalysisScheme(String analysisScheme) {
        this. = analysisScheme;
        return this;
    }

    
Returns a string representation of this object; useful for testing and debugging.

Returns:
A string representation of this object.
See also:
java.lang.Object.toString()
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getDefaultValue() != nullsb.append("DefaultValue: " + getDefaultValue() + ",");
        if (getSourceField() != nullsb.append("SourceField: " + getSourceField() + ",");
        if (isReturnEnabled() != nullsb.append("ReturnEnabled: " + isReturnEnabled() + ",");
        if (isSortEnabled() != nullsb.append("SortEnabled: " + isSortEnabled() + ",");
        if (isHighlightEnabled() != nullsb.append("HighlightEnabled: " + isHighlightEnabled() + ",");
        if (getAnalysisScheme() != nullsb.append("AnalysisScheme: " + getAnalysisScheme() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getDefaultValue() == null) ? 0 : getDefaultValue().hashCode()); 
        hashCode = prime * hashCode + ((getSourceField() == null) ? 0 : getSourceField().hashCode()); 
        hashCode = prime * hashCode + ((isReturnEnabled() == null) ? 0 : isReturnEnabled().hashCode()); 
        hashCode = prime * hashCode + ((isSortEnabled() == null) ? 0 : isSortEnabled().hashCode()); 
        hashCode = prime * hashCode + ((isHighlightEnabled() == null) ? 0 : isHighlightEnabled().hashCode()); 
        hashCode = prime * hashCode + ((getAnalysisScheme() == null) ? 0 : getAnalysisScheme().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof TextOptions == falsereturn false;
        TextOptions other = (TextOptions)obj;
        
        if (other.getDefaultValue() == null ^ this.getDefaultValue() == nullreturn false;
        if (other.getDefaultValue() != null && other.getDefaultValue().equals(this.getDefaultValue()) == falsereturn false
        if (other.getSourceField() == null ^ this.getSourceField() == nullreturn false;
        if (other.getSourceField() != null && other.getSourceField().equals(this.getSourceField()) == falsereturn false
        if (other.isReturnEnabled() == null ^ this.isReturnEnabled() == nullreturn false;
        if (other.isReturnEnabled() != null && other.isReturnEnabled().equals(this.isReturnEnabled()) == falsereturn false
        if (other.isSortEnabled() == null ^ this.isSortEnabled() == nullreturn false;
        if (other.isSortEnabled() != null && other.isSortEnabled().equals(this.isSortEnabled()) == falsereturn false
        if (other.isHighlightEnabled() == null ^ this.isHighlightEnabled() == nullreturn false;
        if (other.isHighlightEnabled() != null && other.isHighlightEnabled().equals(this.isHighlightEnabled()) == falsereturn false
        if (other.getAnalysisScheme() == null ^ this.getAnalysisScheme() == nullreturn false;
        if (other.getAnalysisScheme() != null && other.getAnalysisScheme().equals(this.getAnalysisScheme()) == falsereturn false
        return true;
    }
    
    @Override
    public TextOptions clone() {
        try {
            return (TextOptionssuper.clone();
        
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException(
                    "Got a CloneNotSupportedException from Object.clone() "
                    + "even though we're Cloneable!",
                    e);
        }
        
    }
}
    
New to GrepCode? Check out our FAQ X