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

Replaces an entry (rule) in a network ACL. For more information about network ACLs, see Network ACLs in the Amazon Virtual Private Cloud User Guide .

 
The ID of the ACL.
 
     private String networkAclId;

    
The rule number of the entry to replace.
 
     private Integer ruleNumber;

    
The IP protocol. You can specify all or -1 to mean all protocols.
 
     private String protocol;

    
Indicates whether to allow or deny the traffic that matches the rule.

Constraints:
Allowed Values: allow, deny

 
     private String ruleAction;

    
Indicates whether to replace the egress rule.

Default: If no value is specified, we replace the ingress rule.

 
     private Boolean egress;

    
The network range to allow or deny, in CIDR notation.
 
     private String cidrBlock;

    
ICMP protocol: The ICMP type and code. Required if specifying 1 (ICMP) for the protocol.
 
     private IcmpTypeCode icmpTypeCode;

    
TCP or UDP protocols: The range of ports the rule applies to. Required if specifying 6 (TCP) or 17 (UDP) for the protocol.
 
     private PortRange portRange;

    
The ID of the ACL.

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

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

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

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

    
The rule number of the entry to replace.

Returns:
The rule number of the entry to replace.
    public Integer getRuleNumber() {
        return ;
    }
    
    
The rule number of the entry to replace.

Parameters:
ruleNumber The rule number of the entry to replace.
    public void setRuleNumber(Integer ruleNumber) {
        this. = ruleNumber;
    }
    
    
The rule number of the entry to replace.

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

Parameters:
ruleNumber The rule number of the entry to replace.
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = ruleNumber;
        return this;
    }

    
The IP protocol. You can specify all or -1 to mean all protocols.

Returns:
The IP protocol. You can specify all or -1 to mean all protocols.
    public String getProtocol() {
        return ;
    }
    
    
The IP protocol. You can specify all or -1 to mean all protocols.

Parameters:
protocol The IP protocol. You can specify all or -1 to mean all protocols.
    public void setProtocol(String protocol) {
        this. = protocol;
    }
    
    
The IP protocol. You can specify all or -1 to mean all protocols.

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

Parameters:
protocol The IP protocol. You can specify all or -1 to mean all protocols.
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = protocol;
        return this;
    }

    
Indicates whether to allow or deny the traffic that matches the rule.

Constraints:
Allowed Values: allow, deny

Returns:
Indicates whether to allow or deny the traffic that matches the rule.
See also:
RuleAction
    public String getRuleAction() {
        return ;
    }
    
    
Indicates whether to allow or deny the traffic that matches the rule.

Constraints:
Allowed Values: allow, deny

Parameters:
ruleAction Indicates whether to allow or deny the traffic that matches the rule.
See also:
RuleAction
    public void setRuleAction(String ruleAction) {
        this. = ruleAction;
    }
    
    
Indicates whether to allow or deny the traffic that matches the rule.

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

Constraints:
Allowed Values: allow, deny

Parameters:
ruleAction Indicates whether to allow or deny the traffic that matches the rule.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
RuleAction
    public ReplaceNetworkAclEntryRequest withRuleAction(String ruleAction) {
        this. = ruleAction;
        return this;
    }

    
Indicates whether to allow or deny the traffic that matches the rule.

Constraints:
Allowed Values: allow, deny

Parameters:
ruleAction Indicates whether to allow or deny the traffic that matches the rule.
See also:
RuleAction
    public void setRuleAction(RuleAction ruleAction) {
        this. = ruleAction.toString();
    }
    
    
Indicates whether to allow or deny the traffic that matches the rule.

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

Constraints:
Allowed Values: allow, deny

Parameters:
ruleAction Indicates whether to allow or deny the traffic that matches the rule.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
RuleAction
        this. = ruleAction.toString();
        return this;
    }

    
Indicates whether to replace the egress rule.

Default: If no value is specified, we replace the ingress rule.

Returns:
Indicates whether to replace the egress rule.

Default: If no value is specified, we replace the ingress rule.

    public Boolean isEgress() {
        return ;
    }
    
    
Indicates whether to replace the egress rule.

Default: If no value is specified, we replace the ingress rule.

Parameters:
egress Indicates whether to replace the egress rule.

Default: If no value is specified, we replace the ingress rule.

    public void setEgress(Boolean egress) {
        this. = egress;
    }
    
    
Indicates whether to replace the egress rule.

Default: If no value is specified, we replace the ingress rule.

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

Parameters:
egress Indicates whether to replace the egress rule.

Default: If no value is specified, we replace the ingress rule.

Returns:
A reference to this updated object so that method calls can be chained together.
        this. = egress;
        return this;
    }

    
Indicates whether to replace the egress rule.

Default: If no value is specified, we replace the ingress rule.

Returns:
Indicates whether to replace the egress rule.

Default: If no value is specified, we replace the ingress rule.

    public Boolean getEgress() {
        return ;
    }

    
The network range to allow or deny, in CIDR notation.

Returns:
The network range to allow or deny, in CIDR notation.
    public String getCidrBlock() {
        return ;
    }
    
    
The network range to allow or deny, in CIDR notation.

Parameters:
cidrBlock The network range to allow or deny, in CIDR notation.
    public void setCidrBlock(String cidrBlock) {
        this. = cidrBlock;
    }
    
    
The network range to allow or deny, in CIDR notation.

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

Parameters:
cidrBlock The network range to allow or deny, in CIDR notation.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ReplaceNetworkAclEntryRequest withCidrBlock(String cidrBlock) {
        this. = cidrBlock;
        return this;
    }

    
ICMP protocol: The ICMP type and code. Required if specifying 1 (ICMP) for the protocol.

Returns:
ICMP protocol: The ICMP type and code. Required if specifying 1 (ICMP) for the protocol.
    public IcmpTypeCode getIcmpTypeCode() {
        return ;
    }
    
    
ICMP protocol: The ICMP type and code. Required if specifying 1 (ICMP) for the protocol.

Parameters:
icmpTypeCode ICMP protocol: The ICMP type and code. Required if specifying 1 (ICMP) for the protocol.
    public void setIcmpTypeCode(IcmpTypeCode icmpTypeCode) {
        this. = icmpTypeCode;
    }
    
    
ICMP protocol: The ICMP type and code. Required if specifying 1 (ICMP) for the protocol.

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

Parameters:
icmpTypeCode ICMP protocol: The ICMP type and code. Required if specifying 1 (ICMP) for the protocol.
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = icmpTypeCode;
        return this;
    }

    
TCP or UDP protocols: The range of ports the rule applies to. Required if specifying 6 (TCP) or 17 (UDP) for the protocol.

Returns:
TCP or UDP protocols: The range of ports the rule applies to. Required if specifying 6 (TCP) or 17 (UDP) for the protocol.
    public PortRange getPortRange() {
        return ;
    }
    
    
TCP or UDP protocols: The range of ports the rule applies to. Required if specifying 6 (TCP) or 17 (UDP) for the protocol.

Parameters:
portRange TCP or UDP protocols: The range of ports the rule applies to. Required if specifying 6 (TCP) or 17 (UDP) for the protocol.
    public void setPortRange(PortRange portRange) {
        this. = portRange;
    }
    
    
TCP or UDP protocols: The range of ports the rule applies to. Required if specifying 6 (TCP) or 17 (UDP) for the protocol.

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

Parameters:
portRange TCP or UDP protocols: The range of ports the rule applies to. Required if specifying 6 (TCP) or 17 (UDP) for the protocol.
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = portRange;
        return this;
    }

    
This method is intended for internal use only. Returns the marshaled request configured with additional parameters to enable operation dry-run.
    @Override
        request.addParameter("DryRun", Boolean.toString(true));
        return request;
    }
    
    
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 (getRuleNumber() != nullsb.append("RuleNumber: " + getRuleNumber() + ",");
        if (getProtocol() != nullsb.append("Protocol: " + getProtocol() + ",");
        if (getRuleAction() != nullsb.append("RuleAction: " + getRuleAction() + ",");
        if (isEgress() != nullsb.append("Egress: " + isEgress() + ",");
        if (getCidrBlock() != nullsb.append("CidrBlock: " + getCidrBlock() + ",");
        if (getIcmpTypeCode() != nullsb.append("IcmpTypeCode: " + getIcmpTypeCode() + ",");
        if (getPortRange() != nullsb.append("PortRange: " + getPortRange() );
        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 + ((getRuleNumber() == null) ? 0 : getRuleNumber().hashCode()); 
        hashCode = prime * hashCode + ((getProtocol() == null) ? 0 : getProtocol().hashCode()); 
        hashCode = prime * hashCode + ((getRuleAction() == null) ? 0 : getRuleAction().hashCode()); 
        hashCode = prime * hashCode + ((isEgress() == null) ? 0 : isEgress().hashCode()); 
        hashCode = prime * hashCode + ((getCidrBlock() == null) ? 0 : getCidrBlock().hashCode()); 
        hashCode = prime * hashCode + ((getIcmpTypeCode() == null) ? 0 : getIcmpTypeCode().hashCode()); 
        hashCode = prime * hashCode + ((getPortRange() == null) ? 0 : getPortRange().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof ReplaceNetworkAclEntryRequest == falsereturn false;
        
        if (other.getNetworkAclId() == null ^ this.getNetworkAclId() == nullreturn false;
        if (other.getNetworkAclId() != null && other.getNetworkAclId().equals(this.getNetworkAclId()) == falsereturn false
        if (other.getRuleNumber() == null ^ this.getRuleNumber() == nullreturn false;
        if (other.getRuleNumber() != null && other.getRuleNumber().equals(this.getRuleNumber()) == falsereturn false
        if (other.getProtocol() == null ^ this.getProtocol() == nullreturn false;
        if (other.getProtocol() != null && other.getProtocol().equals(this.getProtocol()) == falsereturn false
        if (other.getRuleAction() == null ^ this.getRuleAction() == nullreturn false;
        if (other.getRuleAction() != null && other.getRuleAction().equals(this.getRuleAction()) == falsereturn false
        if (other.isEgress() == null ^ this.isEgress() == nullreturn false;
        if (other.isEgress() != null && other.isEgress().equals(this.isEgress()) == falsereturn false
        if (other.getCidrBlock() == null ^ this.getCidrBlock() == nullreturn false;
        if (other.getCidrBlock() != null && other.getCidrBlock().equals(this.getCidrBlock()) == falsereturn false
        if (other.getIcmpTypeCode() == null ^ this.getIcmpTypeCode() == nullreturn false;
        if (other.getIcmpTypeCode() != null && other.getIcmpTypeCode().equals(this.getIcmpTypeCode()) == falsereturn false
        if (other.getPortRange() == null ^ this.getPortRange() == nullreturn false;
        if (other.getPortRange() != null && other.getPortRange().equals(this.getPortRange()) == falsereturn false
        return true;
    }
    
    @Override
        
            return (ReplaceNetworkAclEntryRequestsuper.clone();
    }
}
    
New to GrepCode? Check out our FAQ X