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.cloudsearch.model;
 

Identifies the source data for an index field. An optional data transformation can be applied to the source data when populating the index field. By default, the value of the source attribute is copied to the index field.

 
 public class SourceAttribute implements Serializable {

    
Identifies the transformation to apply when copying data from a source attribute.

Constraints:
Allowed Values: Copy, TrimTitle, Map

 
     private String sourceDataFunction;

    
Copies data from a source document attribute to an IndexField.
 
     private SourceData sourceDataCopy;

    
Trims common title words from a source document attribute when populating an IndexField. This can be used to create an IndexField you can use for sorting.
 
     private SourceDataTrimTitle sourceDataTrimTitle;

    
Maps source document attribute values to new values when populating the IndexField.
 
     private SourceDataMap sourceDataMap;

    
Identifies the transformation to apply when copying data from a source attribute.

Constraints:
Allowed Values: Copy, TrimTitle, Map

Returns:
Identifies the transformation to apply when copying data from a source attribute.
See also:
SourceDataFunction
 
     public String getSourceDataFunction() {
         return ;
     }
    
    
Identifies the transformation to apply when copying data from a source attribute.

Constraints:
Allowed Values: Copy, TrimTitle, Map

Parameters:
sourceDataFunction Identifies the transformation to apply when copying data from a source attribute.
See also:
SourceDataFunction
 
     public void setSourceDataFunction(String sourceDataFunction) {
         this. = sourceDataFunction;
     }
    
    
Identifies the transformation to apply when copying data from a source attribute.

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

Constraints:
Allowed Values: Copy, TrimTitle, Map

Parameters:
sourceDataFunction Identifies the transformation to apply when copying data from a source attribute.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
SourceDataFunction
    public SourceAttribute withSourceDataFunction(String sourceDataFunction) {
        this. = sourceDataFunction;
        return this;
    }

    
Identifies the transformation to apply when copying data from a source attribute.

Constraints:
Allowed Values: Copy, TrimTitle, Map

Parameters:
sourceDataFunction Identifies the transformation to apply when copying data from a source attribute.
See also:
SourceDataFunction
    public void setSourceDataFunction(SourceDataFunction sourceDataFunction) {
        this. = sourceDataFunction.toString();
    }
    
    
Identifies the transformation to apply when copying data from a source attribute.

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

Constraints:
Allowed Values: Copy, TrimTitle, Map

Parameters:
sourceDataFunction Identifies the transformation to apply when copying data from a source attribute.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
SourceDataFunction
    public SourceAttribute withSourceDataFunction(SourceDataFunction sourceDataFunction) {
        this. = sourceDataFunction.toString();
        return this;
    }

    
Copies data from a source document attribute to an IndexField.

Returns:
Copies data from a source document attribute to an IndexField.
    public SourceData getSourceDataCopy() {
        return ;
    }
    
    
Copies data from a source document attribute to an IndexField.

Parameters:
sourceDataCopy Copies data from a source document attribute to an IndexField.
    public void setSourceDataCopy(SourceData sourceDataCopy) {
        this. = sourceDataCopy;
    }
    
    
Copies data from a source document attribute to an IndexField.

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

Parameters:
sourceDataCopy Copies data from a source document attribute to an IndexField.
Returns:
A reference to this updated object so that method calls can be chained together.
    public SourceAttribute withSourceDataCopy(SourceData sourceDataCopy) {
        this. = sourceDataCopy;
        return this;
    }

    
Trims common title words from a source document attribute when populating an IndexField. This can be used to create an IndexField you can use for sorting.

Returns:
Trims common title words from a source document attribute when populating an IndexField. This can be used to create an IndexField you can use for sorting.
        return ;
    }
    
    
Trims common title words from a source document attribute when populating an IndexField. This can be used to create an IndexField you can use for sorting.

Parameters:
sourceDataTrimTitle Trims common title words from a source document attribute when populating an IndexField. This can be used to create an IndexField you can use for sorting.
    public void setSourceDataTrimTitle(SourceDataTrimTitle sourceDataTrimTitle) {
        this. = sourceDataTrimTitle;
    }
    
    
Trims common title words from a source document attribute when populating an IndexField. This can be used to create an IndexField you can use for sorting.

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

Parameters:
sourceDataTrimTitle Trims common title words from a source document attribute when populating an IndexField. This can be used to create an IndexField you can use for sorting.
Returns:
A reference to this updated object so that method calls can be chained together.
    public SourceAttribute withSourceDataTrimTitle(SourceDataTrimTitle sourceDataTrimTitle) {
        this. = sourceDataTrimTitle;
        return this;
    }

    
Maps source document attribute values to new values when populating the IndexField.

Returns:
Maps source document attribute values to new values when populating the IndexField.
    public SourceDataMap getSourceDataMap() {
        return ;
    }
    
    
Maps source document attribute values to new values when populating the IndexField.

Parameters:
sourceDataMap Maps source document attribute values to new values when populating the IndexField.
    public void setSourceDataMap(SourceDataMap sourceDataMap) {
        this. = sourceDataMap;
    }
    
    
Maps source document attribute values to new values when populating the IndexField.

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

Parameters:
sourceDataMap Maps source document attribute values to new values when populating the IndexField.
Returns:
A reference to this updated object so that method calls can be chained together.
    public SourceAttribute withSourceDataMap(SourceDataMap sourceDataMap) {
        this. = sourceDataMap;
        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 (getSourceDataFunction() != nullsb.append("SourceDataFunction: " + getSourceDataFunction() + ",");
        if (getSourceDataCopy() != nullsb.append("SourceDataCopy: " + getSourceDataCopy() + ",");
        if (getSourceDataTrimTitle() != nullsb.append("SourceDataTrimTitle: " + getSourceDataTrimTitle() + ",");
        if (getSourceDataMap() != nullsb.append("SourceDataMap: " + getSourceDataMap() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getSourceDataFunction() == null) ? 0 : getSourceDataFunction().hashCode()); 
        hashCode = prime * hashCode + ((getSourceDataCopy() == null) ? 0 : getSourceDataCopy().hashCode()); 
        hashCode = prime * hashCode + ((getSourceDataTrimTitle() == null) ? 0 : getSourceDataTrimTitle().hashCode()); 
        hashCode = prime * hashCode + ((getSourceDataMap() == null) ? 0 : getSourceDataMap().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof SourceAttribute == falsereturn false;
        SourceAttribute other = (SourceAttribute)obj;
        
        if (other.getSourceDataFunction() == null ^ this.getSourceDataFunction() == nullreturn false;
        if (other.getSourceDataFunction() != null && other.getSourceDataFunction().equals(this.getSourceDataFunction()) == falsereturn false
        if (other.getSourceDataCopy() == null ^ this.getSourceDataCopy() == nullreturn false;
        if (other.getSourceDataCopy() != null && other.getSourceDataCopy().equals(this.getSourceDataCopy()) == falsereturn false
        if (other.getSourceDataTrimTitle() == null ^ this.getSourceDataTrimTitle() == nullreturn false;
        if (other.getSourceDataTrimTitle() != null && other.getSourceDataTrimTitle().equals(this.getSourceDataTrimTitle()) == falsereturn false
        if (other.getSourceDataMap() == null ^ this.getSourceDataMap() == nullreturn false;
        if (other.getSourceDataMap() != null && other.getSourceDataMap().equals(this.getSourceDataMap()) == falsereturn false
        return true;
    }
    
}
    
New to GrepCode? Check out our FAQ X