com.amazonaws.services.networkfirewall.model.Address Maven / Gradle / Ivy
Show all versions of aws-java-sdk-networkfirewall Show documentation
/*
* Copyright 2019-2024 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.networkfirewall.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* A single IP address specification. This is used in the MatchAttributes source and destination specifications.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class Address implements Serializable, Cloneable, StructuredPojo {
/**
*
* Specify an IP address or a block of IP addresses in Classless Inter-Domain Routing (CIDR) notation. Network
* Firewall supports all address ranges for IPv4 and IPv6.
*
*
* Examples:
*
*
* -
*
* To configure Network Firewall to inspect for the IP address 192.0.2.44, specify 192.0.2.44/32
.
*
*
* -
*
* To configure Network Firewall to inspect for IP addresses from 192.0.2.0 to 192.0.2.255, specify
* 192.0.2.0/24
.
*
*
* -
*
* To configure Network Firewall to inspect for the IP address 1111:0000:0000:0000:0000:0000:0000:0111, specify
* 1111:0000:0000:0000:0000:0000:0000:0111/128
.
*
*
* -
*
* To configure Network Firewall to inspect for IP addresses from 1111:0000:0000:0000:0000:0000:0000:0000 to
* 1111:0000:0000:0000:ffff:ffff:ffff:ffff, specify 1111:0000:0000:0000:0000:0000:0000:0000/64
.
*
*
*
*
* For more information about CIDR notation, see the Wikipedia entry Classless Inter-Domain Routing.
*
*/
private String addressDefinition;
/**
*
* Specify an IP address or a block of IP addresses in Classless Inter-Domain Routing (CIDR) notation. Network
* Firewall supports all address ranges for IPv4 and IPv6.
*
*
* Examples:
*
*
* -
*
* To configure Network Firewall to inspect for the IP address 192.0.2.44, specify 192.0.2.44/32
.
*
*
* -
*
* To configure Network Firewall to inspect for IP addresses from 192.0.2.0 to 192.0.2.255, specify
* 192.0.2.0/24
.
*
*
* -
*
* To configure Network Firewall to inspect for the IP address 1111:0000:0000:0000:0000:0000:0000:0111, specify
* 1111:0000:0000:0000:0000:0000:0000:0111/128
.
*
*
* -
*
* To configure Network Firewall to inspect for IP addresses from 1111:0000:0000:0000:0000:0000:0000:0000 to
* 1111:0000:0000:0000:ffff:ffff:ffff:ffff, specify 1111:0000:0000:0000:0000:0000:0000:0000/64
.
*
*
*
*
* For more information about CIDR notation, see the Wikipedia entry Classless Inter-Domain Routing.
*
*
* @param addressDefinition
* Specify an IP address or a block of IP addresses in Classless Inter-Domain Routing (CIDR) notation.
* Network Firewall supports all address ranges for IPv4 and IPv6.
*
* Examples:
*
*
* -
*
* To configure Network Firewall to inspect for the IP address 192.0.2.44, specify 192.0.2.44/32
* .
*
*
* -
*
* To configure Network Firewall to inspect for IP addresses from 192.0.2.0 to 192.0.2.255, specify
* 192.0.2.0/24
.
*
*
* -
*
* To configure Network Firewall to inspect for the IP address 1111:0000:0000:0000:0000:0000:0000:0111,
* specify 1111:0000:0000:0000:0000:0000:0000:0111/128
.
*
*
* -
*
* To configure Network Firewall to inspect for IP addresses from 1111:0000:0000:0000:0000:0000:0000:0000 to
* 1111:0000:0000:0000:ffff:ffff:ffff:ffff, specify 1111:0000:0000:0000:0000:0000:0000:0000/64
.
*
*
*
*
* For more information about CIDR notation, see the Wikipedia entry Classless Inter-Domain Routing.
*/
public void setAddressDefinition(String addressDefinition) {
this.addressDefinition = addressDefinition;
}
/**
*
* Specify an IP address or a block of IP addresses in Classless Inter-Domain Routing (CIDR) notation. Network
* Firewall supports all address ranges for IPv4 and IPv6.
*
*
* Examples:
*
*
* -
*
* To configure Network Firewall to inspect for the IP address 192.0.2.44, specify 192.0.2.44/32
.
*
*
* -
*
* To configure Network Firewall to inspect for IP addresses from 192.0.2.0 to 192.0.2.255, specify
* 192.0.2.0/24
.
*
*
* -
*
* To configure Network Firewall to inspect for the IP address 1111:0000:0000:0000:0000:0000:0000:0111, specify
* 1111:0000:0000:0000:0000:0000:0000:0111/128
.
*
*
* -
*
* To configure Network Firewall to inspect for IP addresses from 1111:0000:0000:0000:0000:0000:0000:0000 to
* 1111:0000:0000:0000:ffff:ffff:ffff:ffff, specify 1111:0000:0000:0000:0000:0000:0000:0000/64
.
*
*
*
*
* For more information about CIDR notation, see the Wikipedia entry Classless Inter-Domain Routing.
*
*
* @return Specify an IP address or a block of IP addresses in Classless Inter-Domain Routing (CIDR) notation.
* Network Firewall supports all address ranges for IPv4 and IPv6.
*
* Examples:
*
*
* -
*
* To configure Network Firewall to inspect for the IP address 192.0.2.44, specify
* 192.0.2.44/32
.
*
*
* -
*
* To configure Network Firewall to inspect for IP addresses from 192.0.2.0 to 192.0.2.255, specify
* 192.0.2.0/24
.
*
*
* -
*
* To configure Network Firewall to inspect for the IP address 1111:0000:0000:0000:0000:0000:0000:0111,
* specify 1111:0000:0000:0000:0000:0000:0000:0111/128
.
*
*
* -
*
* To configure Network Firewall to inspect for IP addresses from 1111:0000:0000:0000:0000:0000:0000:0000 to
* 1111:0000:0000:0000:ffff:ffff:ffff:ffff, specify 1111:0000:0000:0000:0000:0000:0000:0000/64
.
*
*
*
*
* For more information about CIDR notation, see the Wikipedia entry Classless Inter-Domain Routing.
*/
public String getAddressDefinition() {
return this.addressDefinition;
}
/**
*
* Specify an IP address or a block of IP addresses in Classless Inter-Domain Routing (CIDR) notation. Network
* Firewall supports all address ranges for IPv4 and IPv6.
*
*
* Examples:
*
*
* -
*
* To configure Network Firewall to inspect for the IP address 192.0.2.44, specify 192.0.2.44/32
.
*
*
* -
*
* To configure Network Firewall to inspect for IP addresses from 192.0.2.0 to 192.0.2.255, specify
* 192.0.2.0/24
.
*
*
* -
*
* To configure Network Firewall to inspect for the IP address 1111:0000:0000:0000:0000:0000:0000:0111, specify
* 1111:0000:0000:0000:0000:0000:0000:0111/128
.
*
*
* -
*
* To configure Network Firewall to inspect for IP addresses from 1111:0000:0000:0000:0000:0000:0000:0000 to
* 1111:0000:0000:0000:ffff:ffff:ffff:ffff, specify 1111:0000:0000:0000:0000:0000:0000:0000/64
.
*
*
*
*
* For more information about CIDR notation, see the Wikipedia entry Classless Inter-Domain Routing.
*
*
* @param addressDefinition
* Specify an IP address or a block of IP addresses in Classless Inter-Domain Routing (CIDR) notation.
* Network Firewall supports all address ranges for IPv4 and IPv6.
*
* Examples:
*
*
* -
*
* To configure Network Firewall to inspect for the IP address 192.0.2.44, specify 192.0.2.44/32
* .
*
*
* -
*
* To configure Network Firewall to inspect for IP addresses from 192.0.2.0 to 192.0.2.255, specify
* 192.0.2.0/24
.
*
*
* -
*
* To configure Network Firewall to inspect for the IP address 1111:0000:0000:0000:0000:0000:0000:0111,
* specify 1111:0000:0000:0000:0000:0000:0000:0111/128
.
*
*
* -
*
* To configure Network Firewall to inspect for IP addresses from 1111:0000:0000:0000:0000:0000:0000:0000 to
* 1111:0000:0000:0000:ffff:ffff:ffff:ffff, specify 1111:0000:0000:0000:0000:0000:0000:0000/64
.
*
*
*
*
* For more information about CIDR notation, see the Wikipedia entry Classless Inter-Domain Routing.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Address withAddressDefinition(String addressDefinition) {
setAddressDefinition(addressDefinition);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getAddressDefinition() != null)
sb.append("AddressDefinition: ").append(getAddressDefinition());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof Address == false)
return false;
Address other = (Address) obj;
if (other.getAddressDefinition() == null ^ this.getAddressDefinition() == null)
return false;
if (other.getAddressDefinition() != null && other.getAddressDefinition().equals(this.getAddressDefinition()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getAddressDefinition() == null) ? 0 : getAddressDefinition().hashCode());
return hashCode;
}
@Override
public Address clone() {
try {
return (Address) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.networkfirewall.model.transform.AddressMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}