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.simpledb.model;
 
 
Container for the parameters to the GetAttributes operation.

Returns all of the attributes associated with the specified item. Optionally, the attributes returned can be limited to one or more attributes by specifying an attribute name parameter.

If the item does not exist on the replica that was accessed for this operation, an empty set is returned. The system does not return an error as it cannot guarantee the item does not exist on other replicas.

NOTE: If GetAttributes is called without being passed any attribute names, all the attributes for the item are returned.

 
 public class GetAttributesRequest extends AmazonWebServiceRequest implements SerializableCloneable {

    
The name of the domain in which to perform the operation.
 
     private String domainName;

    
The name of the item.
 
     private String itemName;

    
The names of the attributes.
 
Determines whether or not strong consistency should be enforced when data is read from SimpleDB. If true, any data previously written to SimpleDB will be returned. Otherwise, results will be consistent eventually, and the client may not see data that was written immediately before your read.
 
     private Boolean consistentRead;

    
Default constructor for a new GetAttributesRequest object. Callers should use the setter or fluent setter (with...) methods to initialize this object after creating it.
 
     public GetAttributesRequest() {}
    
    
Constructs a new GetAttributesRequest object. Callers should use the setter or fluent setter (with...) methods to initialize any additional object members.

Parameters:
domainName The name of the domain in which to perform the operation.
itemName The name of the item.
 
     public GetAttributesRequest(String domainNameString itemName) {
         setDomainName(domainName);
         setItemName(itemName);
     }

    
The name of the domain in which to perform the operation.

Returns:
The name of the domain in which to perform the operation.
 
     public String getDomainName() {
         return ;
     }
    
    
The name of the domain in which to perform the operation.

Parameters:
domainName The name of the domain in which to perform the operation.
    public void setDomainName(String domainName) {
        this. = domainName;
    }
    
    
The name of the domain in which to perform the operation.

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

Parameters:
domainName The name of the domain in which to perform the operation.
Returns:
A reference to this updated object so that method calls can be chained together.
    public GetAttributesRequest withDomainName(String domainName) {
        this. = domainName;
        return this;
    }

    
The name of the item.

Returns:
The name of the item.
    public String getItemName() {
        return ;
    }
    
    
The name of the item.

Parameters:
itemName The name of the item.
    public void setItemName(String itemName) {
        this. = itemName;
    }
    
    
The name of the item.

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

Parameters:
itemName The name of the item.
Returns:
A reference to this updated object so that method calls can be chained together.
    public GetAttributesRequest withItemName(String itemName) {
        this. = itemName;
        return this;
    }

    
The names of the attributes.

Returns:
The names of the attributes.
    public java.util.List<StringgetAttributeNames() {
        if ( == null) {
               = new com.amazonaws.internal.ListWithAutoConstructFlag<String>();
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
The names of the attributes.

Parameters:
attributeNames The names of the attributes.
    public void setAttributeNames(java.util.Collection<StringattributeNames) {
        if (attributeNames == null) {
            this. = null;
            return;
        }
        com.amazonaws.internal.ListWithAutoConstructFlag<StringattributeNamesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(attributeNames.size());
        attributeNamesCopy.addAll(attributeNames);
        this. = attributeNamesCopy;
    }
    
    
The names of the attributes.

NOTE: This method appends the values to the existing list (if any). Use setAttributeNames(java.util.Collection) or withAttributeNames(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.

Parameters:
attributeNames The names of the attributes.
Returns:
A reference to this updated object so that method calls can be chained together.
    public GetAttributesRequest withAttributeNames(String... attributeNames) {
        if (getAttributeNames() == nullsetAttributeNames(new java.util.ArrayList<String>(attributeNames.length));
        for (String value : attributeNames) {
            getAttributeNames().add(value);
        }
        return this;
    }
    
    
The names of the attributes.

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

Parameters:
attributeNames The names of the attributes.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (attributeNames == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<StringattributeNamesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(attributeNames.size());
            attributeNamesCopy.addAll(attributeNames);
            this. = attributeNamesCopy;
        }
        return this;
    }

    
Determines whether or not strong consistency should be enforced when data is read from SimpleDB. If true, any data previously written to SimpleDB will be returned. Otherwise, results will be consistent eventually, and the client may not see data that was written immediately before your read.

Returns:
Determines whether or not strong consistency should be enforced when data is read from SimpleDB. If true, any data previously written to SimpleDB will be returned. Otherwise, results will be consistent eventually, and the client may not see data that was written immediately before your read.
    public Boolean isConsistentRead() {
        return ;
    }
    
    
Determines whether or not strong consistency should be enforced when data is read from SimpleDB. If true, any data previously written to SimpleDB will be returned. Otherwise, results will be consistent eventually, and the client may not see data that was written immediately before your read.

Parameters:
consistentRead Determines whether or not strong consistency should be enforced when data is read from SimpleDB. If true, any data previously written to SimpleDB will be returned. Otherwise, results will be consistent eventually, and the client may not see data that was written immediately before your read.
    public void setConsistentRead(Boolean consistentRead) {
        this. = consistentRead;
    }
    
    
Determines whether or not strong consistency should be enforced when data is read from SimpleDB. If true, any data previously written to SimpleDB will be returned. Otherwise, results will be consistent eventually, and the client may not see data that was written immediately before your read.

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

Parameters:
consistentRead Determines whether or not strong consistency should be enforced when data is read from SimpleDB. If true, any data previously written to SimpleDB will be returned. Otherwise, results will be consistent eventually, and the client may not see data that was written immediately before your read.
Returns:
A reference to this updated object so that method calls can be chained together.
    public GetAttributesRequest withConsistentRead(Boolean consistentRead) {
        this. = consistentRead;
        return this;
    }

    
Determines whether or not strong consistency should be enforced when data is read from SimpleDB. If true, any data previously written to SimpleDB will be returned. Otherwise, results will be consistent eventually, and the client may not see data that was written immediately before your read.

Returns:
Determines whether or not strong consistency should be enforced when data is read from SimpleDB. If true, any data previously written to SimpleDB will be returned. Otherwise, results will be consistent eventually, and the client may not see data that was written immediately before your read.
    public Boolean getConsistentRead() {
        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 (getDomainName() != nullsb.append("DomainName: " + getDomainName() + ",");
        if (getItemName() != nullsb.append("ItemName: " + getItemName() + ",");
        if (getAttributeNames() != nullsb.append("AttributeNames: " + getAttributeNames() + ",");
        if (isConsistentRead() != nullsb.append("ConsistentRead: " + isConsistentRead() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getDomainName() == null) ? 0 : getDomainName().hashCode()); 
        hashCode = prime * hashCode + ((getItemName() == null) ? 0 : getItemName().hashCode()); 
        hashCode = prime * hashCode + ((getAttributeNames() == null) ? 0 : getAttributeNames().hashCode()); 
        hashCode = prime * hashCode + ((isConsistentRead() == null) ? 0 : isConsistentRead().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof GetAttributesRequest == falsereturn false;
        GetAttributesRequest other = (GetAttributesRequest)obj;
        
        if (other.getDomainName() == null ^ this.getDomainName() == nullreturn false;
        if (other.getDomainName() != null && other.getDomainName().equals(this.getDomainName()) == falsereturn false
        if (other.getItemName() == null ^ this.getItemName() == nullreturn false;
        if (other.getItemName() != null && other.getItemName().equals(this.getItemName()) == falsereturn false
        if (other.getAttributeNames() == null ^ this.getAttributeNames() == nullreturn false;
        if (other.getAttributeNames() != null && other.getAttributeNames().equals(this.getAttributeNames()) == falsereturn false
        if (other.isConsistentRead() == null ^ this.isConsistentRead() == nullreturn false;
        if (other.isConsistentRead() != null && other.isConsistentRead().equals(this.isConsistentRead()) == falsereturn false
        return true;
    }
    
    @Override
    public GetAttributesRequest clone() {
        
            return (GetAttributesRequestsuper.clone();
    }
}
    
New to GrepCode? Check out our FAQ X