All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.amazonaws.services.ec2.model.NetworkAcl Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amazon EC2 module holds the client classes that are used for communicating with Amazon EC2 Service

There is a newer version: 1.12.772
Show newest version
/*
 * 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;

import java.io.Serializable;

/**
 * 

* Describes a network ACL. *

*/ public class NetworkAcl implements Serializable, Cloneable { /** * The ID of the network ACL. */ private String networkAclId; /** * The ID of the VPC for the network ACL. */ private String vpcId; /** * Indicates whether this is the default network ACL for the VPC. */ private Boolean isDefault; /** * One or more entries (rules) in the network ACL. */ private com.amazonaws.internal.ListWithAutoConstructFlag entries; /** * Any associations between the network ACL and one or more subnets */ private com.amazonaws.internal.ListWithAutoConstructFlag associations; /** * Any tags assigned to the network ACL. */ private com.amazonaws.internal.ListWithAutoConstructFlag tags; /** * The ID of the network ACL. * * @return The ID of the network ACL. */ public String getNetworkAclId() { return networkAclId; } /** * The ID of the network ACL. * * @param networkAclId The ID of the network ACL. */ public void setNetworkAclId(String networkAclId) { this.networkAclId = networkAclId; } /** * The ID of the network ACL. *

* Returns a reference to this object so that method calls can be chained together. * * @param networkAclId The ID of the network ACL. * * @return A reference to this updated object so that method calls can be chained * together. */ public NetworkAcl withNetworkAclId(String networkAclId) { this.networkAclId = networkAclId; return this; } /** * The ID of the VPC for the network ACL. * * @return The ID of the VPC for the network ACL. */ public String getVpcId() { return vpcId; } /** * The ID of the VPC for the network ACL. * * @param vpcId The ID of the VPC for the network ACL. */ public void setVpcId(String vpcId) { this.vpcId = vpcId; } /** * The ID of the VPC for the network ACL. *

* Returns a reference to this object so that method calls can be chained together. * * @param vpcId The ID of the VPC for the network ACL. * * @return A reference to this updated object so that method calls can be chained * together. */ public NetworkAcl withVpcId(String vpcId) { this.vpcId = vpcId; return this; } /** * Indicates whether this is the default network ACL for the VPC. * * @return Indicates whether this is the default network ACL for the VPC. */ public Boolean isDefault() { return isDefault; } /** * Indicates whether this is the default network ACL for the VPC. * * @param isDefault Indicates whether this is the default network ACL for the VPC. */ public void setIsDefault(Boolean isDefault) { this.isDefault = isDefault; } /** * Indicates whether this is the default network ACL for the VPC. *

* Returns a reference to this object so that method calls can be chained together. * * @param isDefault Indicates whether this is the default network ACL for the VPC. * * @return A reference to this updated object so that method calls can be chained * together. */ public NetworkAcl withIsDefault(Boolean isDefault) { this.isDefault = isDefault; return this; } /** * Indicates whether this is the default network ACL for the VPC. * * @return Indicates whether this is the default network ACL for the VPC. */ public Boolean getIsDefault() { return isDefault; } /** * One or more entries (rules) in the network ACL. * * @return One or more entries (rules) in the network ACL. */ public java.util.List getEntries() { if (entries == null) { entries = new com.amazonaws.internal.ListWithAutoConstructFlag(); entries.setAutoConstruct(true); } return entries; } /** * One or more entries (rules) in the network ACL. * * @param entries One or more entries (rules) in the network ACL. */ public void setEntries(java.util.Collection entries) { if (entries == null) { this.entries = null; return; } com.amazonaws.internal.ListWithAutoConstructFlag entriesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag(entries.size()); entriesCopy.addAll(entries); this.entries = entriesCopy; } /** * One or more entries (rules) in the network ACL. *

* NOTE: This method appends the values to the existing list (if * any). Use {@link #setEntries(java.util.Collection)} or {@link * #withEntries(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. * * @param entries One or more entries (rules) in the network ACL. * * @return A reference to this updated object so that method calls can be chained * together. */ public NetworkAcl withEntries(NetworkAclEntry... entries) { if (getEntries() == null) setEntries(new java.util.ArrayList(entries.length)); for (NetworkAclEntry value : entries) { getEntries().add(value); } return this; } /** * One or more entries (rules) in the network ACL. *

* Returns a reference to this object so that method calls can be chained together. * * @param entries One or more entries (rules) in the network ACL. * * @return A reference to this updated object so that method calls can be chained * together. */ public NetworkAcl withEntries(java.util.Collection entries) { if (entries == null) { this.entries = null; } else { com.amazonaws.internal.ListWithAutoConstructFlag entriesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag(entries.size()); entriesCopy.addAll(entries); this.entries = entriesCopy; } return this; } /** * Any associations between the network ACL and one or more subnets * * @return Any associations between the network ACL and one or more subnets */ public java.util.List getAssociations() { if (associations == null) { associations = new com.amazonaws.internal.ListWithAutoConstructFlag(); associations.setAutoConstruct(true); } return associations; } /** * Any associations between the network ACL and one or more subnets * * @param associations Any associations between the network ACL and one or more subnets */ public void setAssociations(java.util.Collection associations) { if (associations == null) { this.associations = null; return; } com.amazonaws.internal.ListWithAutoConstructFlag associationsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag(associations.size()); associationsCopy.addAll(associations); this.associations = associationsCopy; } /** * Any associations between the network ACL and one or more subnets *

* NOTE: This method appends the values to the existing list (if * any). Use {@link #setAssociations(java.util.Collection)} or {@link * #withAssociations(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. * * @param associations Any associations between the network ACL and one or more subnets * * @return A reference to this updated object so that method calls can be chained * together. */ public NetworkAcl withAssociations(NetworkAclAssociation... associations) { if (getAssociations() == null) setAssociations(new java.util.ArrayList(associations.length)); for (NetworkAclAssociation value : associations) { getAssociations().add(value); } return this; } /** * Any associations between the network ACL and one or more subnets *

* Returns a reference to this object so that method calls can be chained together. * * @param associations Any associations between the network ACL and one or more subnets * * @return A reference to this updated object so that method calls can be chained * together. */ public NetworkAcl withAssociations(java.util.Collection associations) { if (associations == null) { this.associations = null; } else { com.amazonaws.internal.ListWithAutoConstructFlag associationsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag(associations.size()); associationsCopy.addAll(associations); this.associations = associationsCopy; } return this; } /** * Any tags assigned to the network ACL. * * @return Any tags assigned to the network ACL. */ public java.util.List getTags() { if (tags == null) { tags = new com.amazonaws.internal.ListWithAutoConstructFlag(); tags.setAutoConstruct(true); } return tags; } /** * Any tags assigned to the network ACL. * * @param tags Any tags assigned to the network ACL. */ public void setTags(java.util.Collection tags) { if (tags == null) { this.tags = null; return; } com.amazonaws.internal.ListWithAutoConstructFlag tagsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag(tags.size()); tagsCopy.addAll(tags); this.tags = tagsCopy; } /** * Any tags assigned to the network ACL. *

* NOTE: This method appends the values to the existing list (if * any). Use {@link #setTags(java.util.Collection)} or {@link * #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. * * @param tags Any tags assigned to the network ACL. * * @return A reference to this updated object so that method calls can be chained * together. */ public NetworkAcl withTags(Tag... tags) { if (getTags() == null) setTags(new java.util.ArrayList(tags.length)); for (Tag value : tags) { getTags().add(value); } return this; } /** * Any tags assigned to the network ACL. *

* Returns a reference to this object so that method calls can be chained together. * * @param tags Any tags assigned to the network ACL. * * @return A reference to this updated object so that method calls can be chained * together. */ public NetworkAcl withTags(java.util.Collection tags) { if (tags == null) { this.tags = null; } else { com.amazonaws.internal.ListWithAutoConstructFlag tagsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag(tags.size()); tagsCopy.addAll(tags); this.tags = tagsCopy; } return this; } /** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getNetworkAclId() != null) sb.append("NetworkAclId: " + getNetworkAclId() + ","); if (getVpcId() != null) sb.append("VpcId: " + getVpcId() + ","); if (isDefault() != null) sb.append("IsDefault: " + isDefault() + ","); if (getEntries() != null) sb.append("Entries: " + getEntries() + ","); if (getAssociations() != null) sb.append("Associations: " + getAssociations() + ","); if (getTags() != null) sb.append("Tags: " + getTags() ); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getNetworkAclId() == null) ? 0 : getNetworkAclId().hashCode()); hashCode = prime * hashCode + ((getVpcId() == null) ? 0 : getVpcId().hashCode()); hashCode = prime * hashCode + ((isDefault() == null) ? 0 : isDefault().hashCode()); hashCode = prime * hashCode + ((getEntries() == null) ? 0 : getEntries().hashCode()); hashCode = prime * hashCode + ((getAssociations() == null) ? 0 : getAssociations().hashCode()); hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof NetworkAcl == false) return false; NetworkAcl other = (NetworkAcl)obj; if (other.getNetworkAclId() == null ^ this.getNetworkAclId() == null) return false; if (other.getNetworkAclId() != null && other.getNetworkAclId().equals(this.getNetworkAclId()) == false) return false; if (other.getVpcId() == null ^ this.getVpcId() == null) return false; if (other.getVpcId() != null && other.getVpcId().equals(this.getVpcId()) == false) return false; if (other.isDefault() == null ^ this.isDefault() == null) return false; if (other.isDefault() != null && other.isDefault().equals(this.isDefault()) == false) return false; if (other.getEntries() == null ^ this.getEntries() == null) return false; if (other.getEntries() != null && other.getEntries().equals(this.getEntries()) == false) return false; if (other.getAssociations() == null ^ this.getAssociations() == null) return false; if (other.getAssociations() != null && other.getAssociations().equals(this.getAssociations()) == false) return false; if (other.getTags() == null ^ this.getTags() == null) return false; if (other.getTags() != null && other.getTags().equals(this.getTags()) == false) return false; return true; } @Override public NetworkAcl clone() { try { return (NetworkAcl) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException( "Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy