com.amazonaws.services.networkfirewall.model.Header 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;
/**
*
* The basic rule criteria for Network Firewall to use to inspect packet headers in stateful traffic flow inspection.
* Traffic flows that match the criteria are a match for the corresponding StatefulRule.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class Header implements Serializable, Cloneable, StructuredPojo {
/**
*
* The protocol to inspect for. To specify all, you can use IP
, because all traffic on Amazon Web
* Services and on the internet is IP.
*
*/
private String protocol;
/**
*
* The source IP address or address range to inspect for, in CIDR notation. To match with any address, specify
* ANY
.
*
*
* 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 source;
/**
*
* The source port to inspect for. You can specify an individual port, for example 1994
and you can
* specify a port range, for example 1990:1994
. To match with any port, specify ANY
.
*
*/
private String sourcePort;
/**
*
* The direction of traffic flow to inspect. If set to ANY
, the inspection matches bidirectional
* traffic, both from the source to the destination and from the destination to the source. If set to
* FORWARD
, the inspection only matches traffic going from the source to the destination.
*
*/
private String direction;
/**
*
* The destination IP address or address range to inspect for, in CIDR notation. To match with any address, specify
* ANY
.
*
*
* 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 destination;
/**
*
* The destination port to inspect for. You can specify an individual port, for example 1994
and you
* can specify a port range, for example 1990:1994
. To match with any port, specify ANY
.
*
*/
private String destinationPort;
/**
*
* The protocol to inspect for. To specify all, you can use IP
, because all traffic on Amazon Web
* Services and on the internet is IP.
*
*
* @param protocol
* The protocol to inspect for. To specify all, you can use IP
, because all traffic on Amazon
* Web Services and on the internet is IP.
* @see StatefulRuleProtocol
*/
public void setProtocol(String protocol) {
this.protocol = protocol;
}
/**
*
* The protocol to inspect for. To specify all, you can use IP
, because all traffic on Amazon Web
* Services and on the internet is IP.
*
*
* @return The protocol to inspect for. To specify all, you can use IP
, because all traffic on Amazon
* Web Services and on the internet is IP.
* @see StatefulRuleProtocol
*/
public String getProtocol() {
return this.protocol;
}
/**
*
* The protocol to inspect for. To specify all, you can use IP
, because all traffic on Amazon Web
* Services and on the internet is IP.
*
*
* @param protocol
* The protocol to inspect for. To specify all, you can use IP
, because all traffic on Amazon
* Web Services and on the internet is IP.
* @return Returns a reference to this object so that method calls can be chained together.
* @see StatefulRuleProtocol
*/
public Header withProtocol(String protocol) {
setProtocol(protocol);
return this;
}
/**
*
* The protocol to inspect for. To specify all, you can use IP
, because all traffic on Amazon Web
* Services and on the internet is IP.
*
*
* @param protocol
* The protocol to inspect for. To specify all, you can use IP
, because all traffic on Amazon
* Web Services and on the internet is IP.
* @return Returns a reference to this object so that method calls can be chained together.
* @see StatefulRuleProtocol
*/
public Header withProtocol(StatefulRuleProtocol protocol) {
this.protocol = protocol.toString();
return this;
}
/**
*
* The source IP address or address range to inspect for, in CIDR notation. To match with any address, specify
* ANY
.
*
*
* 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 source
* The source IP address or address range to inspect for, in CIDR notation. To match with any address,
* specify ANY
.
*
* 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 setSource(String source) {
this.source = source;
}
/**
*
* The source IP address or address range to inspect for, in CIDR notation. To match with any address, specify
* ANY
.
*
*
* 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 The source IP address or address range to inspect for, in CIDR notation. To match with any address,
* specify ANY
.
*
* 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 getSource() {
return this.source;
}
/**
*
* The source IP address or address range to inspect for, in CIDR notation. To match with any address, specify
* ANY
.
*
*
* 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 source
* The source IP address or address range to inspect for, in CIDR notation. To match with any address,
* specify ANY
.
*
* 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 Header withSource(String source) {
setSource(source);
return this;
}
/**
*
* The source port to inspect for. You can specify an individual port, for example 1994
and you can
* specify a port range, for example 1990:1994
. To match with any port, specify ANY
.
*
*
* @param sourcePort
* The source port to inspect for. You can specify an individual port, for example 1994
and you
* can specify a port range, for example 1990:1994
. To match with any port, specify
* ANY
.
*/
public void setSourcePort(String sourcePort) {
this.sourcePort = sourcePort;
}
/**
*
* The source port to inspect for. You can specify an individual port, for example 1994
and you can
* specify a port range, for example 1990:1994
. To match with any port, specify ANY
.
*
*
* @return The source port to inspect for. You can specify an individual port, for example 1994
and you
* can specify a port range, for example 1990:1994
. To match with any port, specify
* ANY
.
*/
public String getSourcePort() {
return this.sourcePort;
}
/**
*
* The source port to inspect for. You can specify an individual port, for example 1994
and you can
* specify a port range, for example 1990:1994
. To match with any port, specify ANY
.
*
*
* @param sourcePort
* The source port to inspect for. You can specify an individual port, for example 1994
and you
* can specify a port range, for example 1990:1994
. To match with any port, specify
* ANY
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Header withSourcePort(String sourcePort) {
setSourcePort(sourcePort);
return this;
}
/**
*
* The direction of traffic flow to inspect. If set to ANY
, the inspection matches bidirectional
* traffic, both from the source to the destination and from the destination to the source. If set to
* FORWARD
, the inspection only matches traffic going from the source to the destination.
*
*
* @param direction
* The direction of traffic flow to inspect. If set to ANY
, the inspection matches bidirectional
* traffic, both from the source to the destination and from the destination to the source. If set to
* FORWARD
, the inspection only matches traffic going from the source to the destination.
* @see StatefulRuleDirection
*/
public void setDirection(String direction) {
this.direction = direction;
}
/**
*
* The direction of traffic flow to inspect. If set to ANY
, the inspection matches bidirectional
* traffic, both from the source to the destination and from the destination to the source. If set to
* FORWARD
, the inspection only matches traffic going from the source to the destination.
*
*
* @return The direction of traffic flow to inspect. If set to ANY
, the inspection matches
* bidirectional traffic, both from the source to the destination and from the destination to the source. If
* set to FORWARD
, the inspection only matches traffic going from the source to the
* destination.
* @see StatefulRuleDirection
*/
public String getDirection() {
return this.direction;
}
/**
*
* The direction of traffic flow to inspect. If set to ANY
, the inspection matches bidirectional
* traffic, both from the source to the destination and from the destination to the source. If set to
* FORWARD
, the inspection only matches traffic going from the source to the destination.
*
*
* @param direction
* The direction of traffic flow to inspect. If set to ANY
, the inspection matches bidirectional
* traffic, both from the source to the destination and from the destination to the source. If set to
* FORWARD
, the inspection only matches traffic going from the source to the destination.
* @return Returns a reference to this object so that method calls can be chained together.
* @see StatefulRuleDirection
*/
public Header withDirection(String direction) {
setDirection(direction);
return this;
}
/**
*
* The direction of traffic flow to inspect. If set to ANY
, the inspection matches bidirectional
* traffic, both from the source to the destination and from the destination to the source. If set to
* FORWARD
, the inspection only matches traffic going from the source to the destination.
*
*
* @param direction
* The direction of traffic flow to inspect. If set to ANY
, the inspection matches bidirectional
* traffic, both from the source to the destination and from the destination to the source. If set to
* FORWARD
, the inspection only matches traffic going from the source to the destination.
* @return Returns a reference to this object so that method calls can be chained together.
* @see StatefulRuleDirection
*/
public Header withDirection(StatefulRuleDirection direction) {
this.direction = direction.toString();
return this;
}
/**
*
* The destination IP address or address range to inspect for, in CIDR notation. To match with any address, specify
* ANY
.
*
*
* 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 destination
* The destination IP address or address range to inspect for, in CIDR notation. To match with any address,
* specify ANY
.
*
* 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 setDestination(String destination) {
this.destination = destination;
}
/**
*
* The destination IP address or address range to inspect for, in CIDR notation. To match with any address, specify
* ANY
.
*
*
* 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 The destination IP address or address range to inspect for, in CIDR notation. To match with any address,
* specify ANY
.
*
* 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 getDestination() {
return this.destination;
}
/**
*
* The destination IP address or address range to inspect for, in CIDR notation. To match with any address, specify
* ANY
.
*
*
* 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 destination
* The destination IP address or address range to inspect for, in CIDR notation. To match with any address,
* specify ANY
.
*
* 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 Header withDestination(String destination) {
setDestination(destination);
return this;
}
/**
*
* The destination port to inspect for. You can specify an individual port, for example 1994
and you
* can specify a port range, for example 1990:1994
. To match with any port, specify ANY
.
*
*
* @param destinationPort
* The destination port to inspect for. You can specify an individual port, for example 1994
and
* you can specify a port range, for example 1990:1994
. To match with any port, specify
* ANY
.
*/
public void setDestinationPort(String destinationPort) {
this.destinationPort = destinationPort;
}
/**
*
* The destination port to inspect for. You can specify an individual port, for example 1994
and you
* can specify a port range, for example 1990:1994
. To match with any port, specify ANY
.
*
*
* @return The destination port to inspect for. You can specify an individual port, for example 1994
* and you can specify a port range, for example 1990:1994
. To match with any port, specify
* ANY
.
*/
public String getDestinationPort() {
return this.destinationPort;
}
/**
*
* The destination port to inspect for. You can specify an individual port, for example 1994
and you
* can specify a port range, for example 1990:1994
. To match with any port, specify ANY
.
*
*
* @param destinationPort
* The destination port to inspect for. You can specify an individual port, for example 1994
and
* you can specify a port range, for example 1990:1994
. To match with any port, specify
* ANY
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Header withDestinationPort(String destinationPort) {
setDestinationPort(destinationPort);
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 (getProtocol() != null)
sb.append("Protocol: ").append(getProtocol()).append(",");
if (getSource() != null)
sb.append("Source: ").append(getSource()).append(",");
if (getSourcePort() != null)
sb.append("SourcePort: ").append(getSourcePort()).append(",");
if (getDirection() != null)
sb.append("Direction: ").append(getDirection()).append(",");
if (getDestination() != null)
sb.append("Destination: ").append(getDestination()).append(",");
if (getDestinationPort() != null)
sb.append("DestinationPort: ").append(getDestinationPort());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof Header == false)
return false;
Header other = (Header) obj;
if (other.getProtocol() == null ^ this.getProtocol() == null)
return false;
if (other.getProtocol() != null && other.getProtocol().equals(this.getProtocol()) == false)
return false;
if (other.getSource() == null ^ this.getSource() == null)
return false;
if (other.getSource() != null && other.getSource().equals(this.getSource()) == false)
return false;
if (other.getSourcePort() == null ^ this.getSourcePort() == null)
return false;
if (other.getSourcePort() != null && other.getSourcePort().equals(this.getSourcePort()) == false)
return false;
if (other.getDirection() == null ^ this.getDirection() == null)
return false;
if (other.getDirection() != null && other.getDirection().equals(this.getDirection()) == false)
return false;
if (other.getDestination() == null ^ this.getDestination() == null)
return false;
if (other.getDestination() != null && other.getDestination().equals(this.getDestination()) == false)
return false;
if (other.getDestinationPort() == null ^ this.getDestinationPort() == null)
return false;
if (other.getDestinationPort() != null && other.getDestinationPort().equals(this.getDestinationPort()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getProtocol() == null) ? 0 : getProtocol().hashCode());
hashCode = prime * hashCode + ((getSource() == null) ? 0 : getSource().hashCode());
hashCode = prime * hashCode + ((getSourcePort() == null) ? 0 : getSourcePort().hashCode());
hashCode = prime * hashCode + ((getDirection() == null) ? 0 : getDirection().hashCode());
hashCode = prime * hashCode + ((getDestination() == null) ? 0 : getDestination().hashCode());
hashCode = prime * hashCode + ((getDestinationPort() == null) ? 0 : getDestinationPort().hashCode());
return hashCode;
}
@Override
public Header clone() {
try {
return (Header) 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.HeaderMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}