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

Represents attributes that are copied (projected) from the table into an index. These are in addition to the primary key attributes and index key attributes, which are automatically projected.

 
 public class Projection implements SerializableCloneable {

    
The set of attributes that are projected into the index:
  • KEYS_ONLY - Only the index and primary keys are projected into the index.

  • INCLUDE - Only the specified table attributes are projected into the index. The list of projected attributes are in NonKeyAttributes.

  • ALL - All of the table attributes are projected into the index.

Constraints:
Allowed Values: ALL, KEYS_ONLY, INCLUDE

 
     private String projectionType;

    
Represents the non-key attribute names which will be projected into the index.

For local secondary indexes, the total count of NonKeyAttributes summed across all of the local secondary indexes, must not exceed 20. If you project the same attribute into two different indexes, this counts as two distinct attributes when determining the total.

Constraints:
Length: 1 - 20

 
The set of attributes that are projected into the index:
  • KEYS_ONLY - Only the index and primary keys are projected into the index.

  • INCLUDE - Only the specified table attributes are projected into the index. The list of projected attributes are in NonKeyAttributes.

  • ALL - All of the table attributes are projected into the index.

Constraints:
Allowed Values: ALL, KEYS_ONLY, INCLUDE

Returns:
The set of attributes that are projected into the index:
  • KEYS_ONLY - Only the index and primary keys are projected into the index.

  • INCLUDE - Only the specified table attributes are projected into the index. The list of projected attributes are in NonKeyAttributes.

  • ALL - All of the table attributes are projected into the index.

See also:
ProjectionType
 
     public String getProjectionType() {
         return ;
     }
    
    
The set of attributes that are projected into the index:
  • KEYS_ONLY - Only the index and primary keys are projected into the index.

  • INCLUDE - Only the specified table attributes are projected into the index. The list of projected attributes are in NonKeyAttributes.

  • ALL - All of the table attributes are projected into the index.

Constraints:
Allowed Values: ALL, KEYS_ONLY, INCLUDE

Parameters:
projectionType The set of attributes that are projected into the index:
  • KEYS_ONLY - Only the index and primary keys are projected into the index.

  • INCLUDE - Only the specified table attributes are projected into the index. The list of projected attributes are in NonKeyAttributes.

  • ALL - All of the table attributes are projected into the index.

See also:
ProjectionType
    public void setProjectionType(String projectionType) {
        this. = projectionType;
    }
    
    
The set of attributes that are projected into the index:
  • KEYS_ONLY - Only the index and primary keys are projected into the index.

  • INCLUDE - Only the specified table attributes are projected into the index. The list of projected attributes are in NonKeyAttributes.

  • ALL - All of the table attributes are projected into the index.

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

Constraints:
Allowed Values: ALL, KEYS_ONLY, INCLUDE

Parameters:
projectionType The set of attributes that are projected into the index:
  • KEYS_ONLY - Only the index and primary keys are projected into the index.

  • INCLUDE - Only the specified table attributes are projected into the index. The list of projected attributes are in NonKeyAttributes.

  • ALL - All of the table attributes are projected into the index.

Returns:
A reference to this updated object so that method calls can be chained together.
See also:
ProjectionType
    public Projection withProjectionType(String projectionType) {
        this. = projectionType;
        return this;
    }

    
The set of attributes that are projected into the index:
  • KEYS_ONLY - Only the index and primary keys are projected into the index.

  • INCLUDE - Only the specified table attributes are projected into the index. The list of projected attributes are in NonKeyAttributes.

  • ALL - All of the table attributes are projected into the index.

Constraints:
Allowed Values: ALL, KEYS_ONLY, INCLUDE

Parameters:
projectionType The set of attributes that are projected into the index:
  • KEYS_ONLY - Only the index and primary keys are projected into the index.

  • INCLUDE - Only the specified table attributes are projected into the index. The list of projected attributes are in NonKeyAttributes.

  • ALL - All of the table attributes are projected into the index.

See also:
ProjectionType
    public void setProjectionType(ProjectionType projectionType) {
        this. = projectionType.toString();
    }
    
    
The set of attributes that are projected into the index:
  • KEYS_ONLY - Only the index and primary keys are projected into the index.

  • INCLUDE - Only the specified table attributes are projected into the index. The list of projected attributes are in NonKeyAttributes.

  • ALL - All of the table attributes are projected into the index.

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

Constraints:
Allowed Values: ALL, KEYS_ONLY, INCLUDE

Parameters:
projectionType The set of attributes that are projected into the index:
  • KEYS_ONLY - Only the index and primary keys are projected into the index.

  • INCLUDE - Only the specified table attributes are projected into the index. The list of projected attributes are in NonKeyAttributes.

  • ALL - All of the table attributes are projected into the index.

Returns:
A reference to this updated object so that method calls can be chained together.
See also:
ProjectionType
    public Projection withProjectionType(ProjectionType projectionType) {
        this. = projectionType.toString();
        return this;
    }

    
Represents the non-key attribute names which will be projected into the index.

For local secondary indexes, the total count of NonKeyAttributes summed across all of the local secondary indexes, must not exceed 20. If you project the same attribute into two different indexes, this counts as two distinct attributes when determining the total.

Constraints:
Length: 1 - 20

Returns:
Represents the non-key attribute names which will be projected into the index.

For local secondary indexes, the total count of NonKeyAttributes summed across all of the local secondary indexes, must not exceed 20. If you project the same attribute into two different indexes, this counts as two distinct attributes when determining the total.

    public java.util.List<StringgetNonKeyAttributes() {
        return ;
    }
    
    
Represents the non-key attribute names which will be projected into the index.

For local secondary indexes, the total count of NonKeyAttributes summed across all of the local secondary indexes, must not exceed 20. If you project the same attribute into two different indexes, this counts as two distinct attributes when determining the total.

Constraints:
Length: 1 - 20

Parameters:
nonKeyAttributes Represents the non-key attribute names which will be projected into the index.

For local secondary indexes, the total count of NonKeyAttributes summed across all of the local secondary indexes, must not exceed 20. If you project the same attribute into two different indexes, this counts as two distinct attributes when determining the total.

    public void setNonKeyAttributes(java.util.Collection<StringnonKeyAttributes) {
        if (nonKeyAttributes == null) {
            this. = null;
            return;
        }
        com.amazonaws.internal.ListWithAutoConstructFlag<StringnonKeyAttributesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(nonKeyAttributes.size());
        nonKeyAttributesCopy.addAll(nonKeyAttributes);
        this. = nonKeyAttributesCopy;
    }
    
    
Represents the non-key attribute names which will be projected into the index.

For local secondary indexes, the total count of NonKeyAttributes summed across all of the local secondary indexes, must not exceed 20. If you project the same attribute into two different indexes, this counts as two distinct attributes when determining the total.

NOTE: This method appends the values to the existing list (if any). Use setNonKeyAttributes(java.util.Collection) or withNonKeyAttributes(java.util.Collection) if you want to override the existing values.

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

Constraints:
Length: 1 - 20

Parameters:
nonKeyAttributes Represents the non-key attribute names which will be projected into the index.

For local secondary indexes, the total count of NonKeyAttributes summed across all of the local secondary indexes, must not exceed 20. If you project the same attribute into two different indexes, this counts as two distinct attributes when determining the total.

Returns:
A reference to this updated object so that method calls can be chained together.
    public Projection withNonKeyAttributes(String... nonKeyAttributes) {
        if (getNonKeyAttributes() == nullsetNonKeyAttributes(new java.util.ArrayList<String>(nonKeyAttributes.length));
        for (String value : nonKeyAttributes) {
            getNonKeyAttributes().add(value);
        }
        return this;
    }
    
    
Represents the non-key attribute names which will be projected into the index.

For local secondary indexes, the total count of NonKeyAttributes summed across all of the local secondary indexes, must not exceed 20. If you project the same attribute into two different indexes, this counts as two distinct attributes when determining the total.

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

Constraints:
Length: 1 - 20

Parameters:
nonKeyAttributes Represents the non-key attribute names which will be projected into the index.

For local secondary indexes, the total count of NonKeyAttributes summed across all of the local secondary indexes, must not exceed 20. If you project the same attribute into two different indexes, this counts as two distinct attributes when determining the total.

Returns:
A reference to this updated object so that method calls can be chained together.
    public Projection withNonKeyAttributes(java.util.Collection<StringnonKeyAttributes) {
        if (nonKeyAttributes == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<StringnonKeyAttributesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(nonKeyAttributes.size());
            nonKeyAttributesCopy.addAll(nonKeyAttributes);
            this. = nonKeyAttributesCopy;
        }
        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 (getProjectionType() != nullsb.append("ProjectionType: " + getProjectionType() + ",");
        if (getNonKeyAttributes() != nullsb.append("NonKeyAttributes: " + getNonKeyAttributes() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getProjectionType() == null) ? 0 : getProjectionType().hashCode()); 
        hashCode = prime * hashCode + ((getNonKeyAttributes() == null) ? 0 : getNonKeyAttributes().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof Projection == falsereturn false;
        Projection other = (Projection)obj;
        
        if (other.getProjectionType() == null ^ this.getProjectionType() == nullreturn false;
        if (other.getProjectionType() != null && other.getProjectionType().equals(this.getProjectionType()) == falsereturn false
        if (other.getNonKeyAttributes() == null ^ this.getNonKeyAttributes() == nullreturn false;
        if (other.getNonKeyAttributes() != null && other.getNonKeyAttributes().equals(this.getNonKeyAttributes()) == falsereturn false
        return true;
    }
    
    @Override
    public Projection clone() {
        try {
            return (Projectionsuper.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