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 a 64-bit signed integer field. Present if IndexFieldType specifies the field is of type int . All options are enabled by default.

 
 public class IntOptions implements SerializableCloneable {

    
A value to use for the field if the field isn't specified for a document. This can be important if you are using the field in an expression and that field is not present in every document.
 
     private Long defaultValue;

    
The name of the source field to map to the field.

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

 
     private String sourceField;

    
Whether facet information can be returned for the field.
 
     private Boolean facetEnabled;

    
Whether the contents of the field are searchable.
 
     private Boolean searchEnabled;

    
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;

    
A value to use for the field if the field isn't specified for a document. This can be important if you are using the field in an expression and that field is not present in every document.

Returns:
A value to use for the field if the field isn't specified for a document. This can be important if you are using the field in an expression and that field is not present in every document.
 
     public Long getDefaultValue() {
         return ;
     }
    
    
A value to use for the field if the field isn't specified for a document. This can be important if you are using the field in an expression and that field is not present in every document.

Parameters:
defaultValue A value to use for the field if the field isn't specified for a document. This can be important if you are using the field in an expression and that field is not present in every document.
 
     public void setDefaultValue(Long defaultValue) {
         this. = defaultValue;
     }
    
    
A value to use for the field if the field isn't specified for a document. This can be important if you are using the field in an expression and that field is not present in every document.

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

Parameters:
defaultValue A value to use for the field if the field isn't specified for a document. This can be important if you are using the field in an expression and that field is not present in every document.
Returns:
A reference to this updated object so that method calls can be chained together.
    public IntOptions withDefaultValue(Long defaultValue) {
        this. = defaultValue;
        return this;
    }

    
The name of the source field to map to the field.

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

Returns:
The name of the source field to map to the field.
    public String getSourceField() {
        return ;
    }
    
    
The name of the source field to map to the field.

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

Parameters:
sourceField The name of the source field to map to the field.
    public void setSourceField(String sourceField) {
        this. = sourceField;
    }
    
    
The name of the source field to map to the field.

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 The name of the source field to map to the field.
Returns:
A reference to this updated object so that method calls can be chained together.
    public IntOptions withSourceField(String sourceField) {
        this. = sourceField;
        return this;
    }

    
Whether facet information can be returned for the field.

Returns:
Whether facet information can be returned for the field.
    public Boolean isFacetEnabled() {
        return ;
    }
    
    
Whether facet information can be returned for the field.

Parameters:
facetEnabled Whether facet information can be returned for the field.
    public void setFacetEnabled(Boolean facetEnabled) {
        this. = facetEnabled;
    }
    
    
Whether facet information can be returned for the field.

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

Parameters:
facetEnabled Whether facet information can be returned for the field.
Returns:
A reference to this updated object so that method calls can be chained together.
    public IntOptions withFacetEnabled(Boolean facetEnabled) {
        this. = facetEnabled;
        return this;
    }

    
Whether facet information can be returned for the field.

Returns:
Whether facet information can be returned for the field.
    public Boolean getFacetEnabled() {
        return ;
    }

    
Whether the contents of the field are searchable.

Returns:
Whether the contents of the field are searchable.
    public Boolean isSearchEnabled() {
        return ;
    }
    
    
Whether the contents of the field are searchable.

Parameters:
searchEnabled Whether the contents of the field are searchable.
    public void setSearchEnabled(Boolean searchEnabled) {
        this. = searchEnabled;
    }
    
    
Whether the contents of the field are searchable.

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

Parameters:
searchEnabled Whether the contents of the field are searchable.
Returns:
A reference to this updated object so that method calls can be chained together.
    public IntOptions withSearchEnabled(Boolean searchEnabled) {
        this. = searchEnabled;
        return this;
    }

    
Whether the contents of the field are searchable.

Returns:
Whether the contents of the field are searchable.
    public Boolean getSearchEnabled() {
        return ;
    }

    
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 IntOptions 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 IntOptions 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 ;
    }

    
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 (isFacetEnabled() != nullsb.append("FacetEnabled: " + isFacetEnabled() + ",");
        if (isSearchEnabled() != nullsb.append("SearchEnabled: " + isSearchEnabled() + ",");
        if (isReturnEnabled() != nullsb.append("ReturnEnabled: " + isReturnEnabled() + ",");
        if (isSortEnabled() != nullsb.append("SortEnabled: " + isSortEnabled() );
        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 + ((isFacetEnabled() == null) ? 0 : isFacetEnabled().hashCode()); 
        hashCode = prime * hashCode + ((isSearchEnabled() == null) ? 0 : isSearchEnabled().hashCode()); 
        hashCode = prime * hashCode + ((isReturnEnabled() == null) ? 0 : isReturnEnabled().hashCode()); 
        hashCode = prime * hashCode + ((isSortEnabled() == null) ? 0 : isSortEnabled().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof IntOptions == falsereturn false;
        IntOptions other = (IntOptions)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.isFacetEnabled() == null ^ this.isFacetEnabled() == nullreturn false;
        if (other.isFacetEnabled() != null && other.isFacetEnabled().equals(this.isFacetEnabled()) == falsereturn false
        if (other.isSearchEnabled() == null ^ this.isSearchEnabled() == nullreturn false;
        if (other.isSearchEnabled() != null && other.isSearchEnabled().equals(this.isSearchEnabled()) == 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
        return true;
    }
    
    @Override
    public IntOptions clone() {
        try {
            return (IntOptionssuper.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