Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010-2014 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.ec2.model;
 

Describes an account attribute.

 
 public class AccountAttribute implements Serializable {

    
The name of the account attribute.
 
     private String attributeName;

    
One or more values for the account attribute.
 
The name of the account attribute.

Returns:
The name of the account attribute.
 
     public String getAttributeName() {
         return ;
     }
    
    
The name of the account attribute.

Parameters:
attributeName The name of the account attribute.
 
     public void setAttributeName(String attributeName) {
         this. = attributeName;
     }
    
    
The name of the account attribute.

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

Parameters:
attributeName The name of the account attribute.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public AccountAttribute withAttributeName(String attributeName) {
         this. = attributeName;
         return this;
     }

    
One or more values for the account attribute.

Returns:
One or more values for the account attribute.
 
         if ( == null) {
               .setAutoConstruct(true);
         }
         return ;
     }
    
    
One or more values for the account attribute.

Parameters:
attributeValues One or more values for the account attribute.
 
     public void setAttributeValues(java.util.Collection<AccountAttributeValueattributeValues) {
         if (attributeValues == null) {
             this. = null;
             return;
         }
         attributeValuesCopy.addAll(attributeValues);
         this. = attributeValuesCopy;
     }
    
    
One or more values for the account attribute.

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

Parameters:
attributeValues One or more values for the account attribute.
Returns:
A reference to this updated object so that method calls can be chained together.
    public AccountAttribute withAttributeValues(AccountAttributeValue... attributeValues) {
        if (getAttributeValues() == nullsetAttributeValues(new java.util.ArrayList<AccountAttributeValue>(attributeValues.length));
        for (AccountAttributeValue value : attributeValues) {
            getAttributeValues().add(value);
        }
        return this;
    }
    
    
One or more values for the account attribute.

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

Parameters:
attributeValues One or more values for the account attribute.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (attributeValues == null) {
            this. = null;
        } else {
            attributeValuesCopy.addAll(attributeValues);
            this. = attributeValuesCopy;
        }
        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 (getAttributeName() != nullsb.append("AttributeName: " + getAttributeName() + ",");
        if (getAttributeValues() != nullsb.append("AttributeValues: " + getAttributeValues() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getAttributeName() == null) ? 0 : getAttributeName().hashCode()); 
        hashCode = prime * hashCode + ((getAttributeValues() == null) ? 0 : getAttributeValues().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof AccountAttribute == falsereturn false;
        AccountAttribute other = (AccountAttribute)obj;
        
        if (other.getAttributeName() == null ^ this.getAttributeName() == nullreturn false;
        if (other.getAttributeName() != null && other.getAttributeName().equals(this.getAttributeName()) == falsereturn false
        if (other.getAttributeValues() == null ^ this.getAttributeValues() == nullreturn false;
        if (other.getAttributeValues() != null && other.getAttributeValues().equals(this.getAttributeValues()) == falsereturn false
        return true;
    }
    
}
    
New to GrepCode? Check out our FAQ X