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

Describes a set of DHCP options.

 
 public class DhcpOptions implements SerializableCloneable {

    
The ID of the set of DHCP options.
 
     private String dhcpOptionsId;

    
One or more DHCP options in the set.
 
Any tags assigned to the DHCP options set.
 
The ID of the set of DHCP options.

Returns:
The ID of the set of DHCP options.
 
     public String getDhcpOptionsId() {
         return ;
     }
    
    
The ID of the set of DHCP options.

Parameters:
dhcpOptionsId The ID of the set of DHCP options.
 
     public void setDhcpOptionsId(String dhcpOptionsId) {
         this. = dhcpOptionsId;
     }
    
    
The ID of the set of DHCP options.

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

Parameters:
dhcpOptionsId The ID of the set of DHCP options.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public DhcpOptions withDhcpOptionsId(String dhcpOptionsId) {
         this. = dhcpOptionsId;
         return this;
     }

    
One or more DHCP options in the set.

Returns:
One or more DHCP options in the set.
 
         if ( == null) {
               .setAutoConstruct(true);
         }
         return ;
     }
    
    
One or more DHCP options in the set.

Parameters:
dhcpConfigurations One or more DHCP options in the set.
 
     public void setDhcpConfigurations(java.util.Collection<DhcpConfigurationdhcpConfigurations) {
         if (dhcpConfigurations == null) {
             this. = null;
             return;
         }
         dhcpConfigurationsCopy.addAll(dhcpConfigurations);
         this. = dhcpConfigurationsCopy;
    }
    
    
One or more DHCP options in the set.

NOTE: This method appends the values to the existing list (if any). Use setDhcpConfigurations(java.util.Collection) or withDhcpConfigurations(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:
dhcpConfigurations One or more DHCP options in the set.
Returns:
A reference to this updated object so that method calls can be chained together.
    public DhcpOptions withDhcpConfigurations(DhcpConfiguration... dhcpConfigurations) {
        if (getDhcpConfigurations() == nullsetDhcpConfigurations(new java.util.ArrayList<DhcpConfiguration>(dhcpConfigurations.length));
        for (DhcpConfiguration value : dhcpConfigurations) {
            getDhcpConfigurations().add(value);
        }
        return this;
    }
    
    
One or more DHCP options in the set.

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

Parameters:
dhcpConfigurations One or more DHCP options in the set.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (dhcpConfigurations == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<DhcpConfigurationdhcpConfigurationsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<DhcpConfiguration>(dhcpConfigurations.size());
            dhcpConfigurationsCopy.addAll(dhcpConfigurations);
            this. = dhcpConfigurationsCopy;
        }
        return this;
    }

    
Any tags assigned to the DHCP options set.

Returns:
Any tags assigned to the DHCP options set.
    public java.util.List<TaggetTags() {
        if ( == null) {
               = new com.amazonaws.internal.ListWithAutoConstructFlag<Tag>();
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
Any tags assigned to the DHCP options set.

Parameters:
tags Any tags assigned to the DHCP options set.
    public void setTags(java.util.Collection<Tagtags) {
        if (tags == null) {
            this. = null;
            return;
        }
        tagsCopy.addAll(tags);
        this. = tagsCopy;
    }
    
    
Any tags assigned to the DHCP options set.

NOTE: This method appends the values to the existing list (if any). Use setTags(java.util.Collection) or withTags(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:
tags Any tags assigned to the DHCP options set.
Returns:
A reference to this updated object so that method calls can be chained together.
    public DhcpOptions withTags(Tag... tags) {
        if (getTags() == nullsetTags(new java.util.ArrayList<Tag>(tags.length));
        for (Tag value : tags) {
            getTags().add(value);
        }
        return this;
    }
    
    
Any tags assigned to the DHCP options set.

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

Parameters:
tags Any tags assigned to the DHCP options set.
Returns:
A reference to this updated object so that method calls can be chained together.
    public DhcpOptions withTags(java.util.Collection<Tagtags) {
        if (tags == null) {
            this. = null;
        } else {
            tagsCopy.addAll(tags);
            this. = tagsCopy;
        }
        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 (getDhcpOptionsId() != nullsb.append("DhcpOptionsId: " + getDhcpOptionsId() + ",");
        if (getDhcpConfigurations() != nullsb.append("DhcpConfigurations: " + getDhcpConfigurations() + ",");
        if (getTags() != nullsb.append("Tags: " + getTags() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getDhcpOptionsId() == null) ? 0 : getDhcpOptionsId().hashCode()); 
        hashCode = prime * hashCode + ((getDhcpConfigurations() == null) ? 0 : getDhcpConfigurations().hashCode()); 
        hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof DhcpOptions == falsereturn false;
        DhcpOptions other = (DhcpOptions)obj;
        
        if (other.getDhcpOptionsId() == null ^ this.getDhcpOptionsId() == nullreturn false;
        if (other.getDhcpOptionsId() != null && other.getDhcpOptionsId().equals(this.getDhcpOptionsId()) == falsereturn false
        if (other.getDhcpConfigurations() == null ^ this.getDhcpConfigurations() == nullreturn false;
        if (other.getDhcpConfigurations() != null && other.getDhcpConfigurations().equals(this.getDhcpConfigurations()) == falsereturn false
        if (other.getTags() == null ^ this.getTags() == nullreturn false;
        if (other.getTags() != null && other.getTags().equals(this.getTags()) == falsereturn false
        return true;
    }
    
    @Override
    public DhcpOptions clone() {
        try {
            return (DhcpOptionssuper.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