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 network ACL.

 
 public class NetworkAcl implements SerializableCloneable {

    
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.
 
Any associations between the network ACL and one or more subnets
 
Any tags assigned to the network ACL.
 
The ID of the network ACL.

Returns:
The ID of the network ACL.
 
     public String getNetworkAclId() {
         return ;
     }
    
    
The ID of the network ACL.

Parameters:
networkAclId The ID of the network ACL.
 
     public void setNetworkAclId(String networkAclId) {
         this. = networkAclId;
     }
    
    
The ID of the network ACL.

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

Parameters:
networkAclId The ID of the network ACL.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public NetworkAcl withNetworkAclId(String networkAclId) {
         this. = networkAclId;
         return this;
     }

    
The ID of the VPC for the network ACL.

Returns:
The ID of the VPC for the network ACL.
 
     public String getVpcId() {
         return ;
     }
    
    
The ID of the VPC for the network ACL.

Parameters:
vpcId The ID of the VPC for the network ACL.
    public void setVpcId(String vpcId) {
        this. = vpcId;
    }
    
    
The ID of the VPC for the network ACL.

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

Parameters:
vpcId The ID of the VPC for the network ACL.
Returns:
A reference to this updated object so that method calls can be chained together.
    public NetworkAcl withVpcId(String vpcId) {
        this. = vpcId;
        return this;
    }

    
Indicates whether this is the default network ACL for the VPC.

Returns:
Indicates whether this is the default network ACL for the VPC.
    public Boolean isDefault() {
        return ;
    }
    
    
Indicates whether this is the default network ACL for the VPC.

Parameters:
isDefault Indicates whether this is the default network ACL for the VPC.
    public void setIsDefault(Boolean isDefault) {
        this. = 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.

Parameters:
isDefault Indicates whether this is the default network ACL for the VPC.
Returns:
A reference to this updated object so that method calls can be chained together.
    public NetworkAcl withIsDefault(Boolean isDefault) {
        this. = isDefault;
        return this;
    }

    
Indicates whether this is the default network ACL for the VPC.

Returns:
Indicates whether this is the default network ACL for the VPC.
    public Boolean getIsDefault() {
        return ;
    }

    
One or more entries (rules) in the network ACL.

Returns:
One or more entries (rules) in the network ACL.
    public java.util.List<NetworkAclEntrygetEntries() {
        if ( == null) {
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
One or more entries (rules) in the network ACL.

Parameters:
entries One or more entries (rules) in the network ACL.
    public void setEntries(java.util.Collection<NetworkAclEntryentries) {
        if (entries == null) {
            this. = null;
            return;
        }
        entriesCopy.addAll(entries);
        this. = entriesCopy;
    }
    
    
One or more entries (rules) in the network ACL.

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

Parameters:
entries One or more entries (rules) in the network ACL.
Returns:
A reference to this updated object so that method calls can be chained together.
    public NetworkAcl withEntries(NetworkAclEntry... entries) {
        if (getEntries() == nullsetEntries(new java.util.ArrayList<NetworkAclEntry>(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.

Parameters:
entries One or more entries (rules) in the network ACL.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (entries == null) {
            this. = null;
        } else {
            entriesCopy.addAll(entries);
            this. = entriesCopy;
        }
        return this;
    }

    
Any associations between the network ACL and one or more subnets

Returns:
Any associations between the network ACL and one or more subnets
        if ( == null) {
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
Any associations between the network ACL and one or more subnets

Parameters:
associations Any associations between the network ACL and one or more subnets
    public void setAssociations(java.util.Collection<NetworkAclAssociationassociations) {
        if (associations == null) {
            this. = null;
            return;
        }
        associationsCopy.addAll(associations);
        this. = 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 setAssociations(java.util.Collection) or 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.

Parameters:
associations Any associations between the network ACL and one or more subnets
Returns:
A reference to this updated object so that method calls can be chained together.
    public NetworkAcl withAssociations(NetworkAclAssociation... associations) {
        if (getAssociations() == nullsetAssociations(new java.util.ArrayList<NetworkAclAssociation>(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.

Parameters:
associations Any associations between the network ACL and one or more subnets
Returns:
A reference to this updated object so that method calls can be chained together.
        if (associations == null) {
            this. = null;
        } else {
            associationsCopy.addAll(associations);
            this. = associationsCopy;
        }
        return this;
    }

    
Any tags assigned to the network ACL.

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

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

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 network ACL.
Returns:
A reference to this updated object so that method calls can be chained together.
    public NetworkAcl 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 network ACL.

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

Parameters:
tags Any tags assigned to the network ACL.
Returns:
A reference to this updated object so that method calls can be chained together.
    public NetworkAcl 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 (getNetworkAclId() != nullsb.append("NetworkAclId: " + getNetworkAclId() + ",");
        if (getVpcId() != nullsb.append("VpcId: " + getVpcId() + ",");
        if (isDefault() != nullsb.append("IsDefault: " + isDefault() + ",");
        if (getEntries() != nullsb.append("Entries: " + getEntries() + ",");
        if (getAssociations() != nullsb.append("Associations: " + getAssociations() + ",");
        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 + ((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 == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof NetworkAcl == falsereturn false;
        NetworkAcl other = (NetworkAcl)obj;
        
        if (other.getNetworkAclId() == null ^ this.getNetworkAclId() == nullreturn false;
        if (other.getNetworkAclId() != null && other.getNetworkAclId().equals(this.getNetworkAclId()) == falsereturn false
        if (other.getVpcId() == null ^ this.getVpcId() == nullreturn false;
        if (other.getVpcId() != null && other.getVpcId().equals(this.getVpcId()) == falsereturn false
        if (other.isDefault() == null ^ this.isDefault() == nullreturn false;
        if (other.isDefault() != null && other.isDefault().equals(this.isDefault()) == falsereturn false
        if (other.getEntries() == null ^ this.getEntries() == nullreturn false;
        if (other.getEntries() != null && other.getEntries().equals(this.getEntries()) == falsereturn false
        if (other.getAssociations() == null ^ this.getAssociations() == nullreturn false;
        if (other.getAssociations() != null && other.getAssociations().equals(this.getAssociations()) == 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 NetworkAcl clone() {
        try {
            return (NetworkAclsuper.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