com.amazonaws.services.securityhub.model.RuleGroupSourceStatelessRuleDefinition Maven / Gradle / Ivy
Show all versions of aws-java-sdk-securityhub 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.securityhub.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* The definition of the stateless rule.
*
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class RuleGroupSourceStatelessRuleDefinition implements Serializable, Cloneable, StructuredPojo {
/**
*
* The actions to take on a packet that matches one of the stateless rule definition's match attributes. You must
* specify a standard action (aws:pass
, aws:drop
, or aws:forward_to_sfe
). You
* can then add custom actions.
*
*/
private java.util.List actions;
/**
*
* The criteria for Network Firewall to use to inspect an individual packet in a stateless rule inspection.
*
*/
private RuleGroupSourceStatelessRuleMatchAttributes matchAttributes;
/**
*
* The actions to take on a packet that matches one of the stateless rule definition's match attributes. You must
* specify a standard action (aws:pass
, aws:drop
, or aws:forward_to_sfe
). You
* can then add custom actions.
*
*
* @return The actions to take on a packet that matches one of the stateless rule definition's match attributes. You
* must specify a standard action (aws:pass
, aws:drop
, or
* aws:forward_to_sfe
). You can then add custom actions.
*/
public java.util.List getActions() {
return actions;
}
/**
*
* The actions to take on a packet that matches one of the stateless rule definition's match attributes. You must
* specify a standard action (aws:pass
, aws:drop
, or aws:forward_to_sfe
). You
* can then add custom actions.
*
*
* @param actions
* The actions to take on a packet that matches one of the stateless rule definition's match attributes. You
* must specify a standard action (aws:pass
, aws:drop
, or
* aws:forward_to_sfe
). You can then add custom actions.
*/
public void setActions(java.util.Collection actions) {
if (actions == null) {
this.actions = null;
return;
}
this.actions = new java.util.ArrayList(actions);
}
/**
*
* The actions to take on a packet that matches one of the stateless rule definition's match attributes. You must
* specify a standard action (aws:pass
, aws:drop
, or aws:forward_to_sfe
). You
* can then add custom actions.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setActions(java.util.Collection)} or {@link #withActions(java.util.Collection)} if you want to override
* the existing values.
*
*
* @param actions
* The actions to take on a packet that matches one of the stateless rule definition's match attributes. You
* must specify a standard action (aws:pass
, aws:drop
, or
* aws:forward_to_sfe
). You can then add custom actions.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RuleGroupSourceStatelessRuleDefinition withActions(String... actions) {
if (this.actions == null) {
setActions(new java.util.ArrayList(actions.length));
}
for (String ele : actions) {
this.actions.add(ele);
}
return this;
}
/**
*
* The actions to take on a packet that matches one of the stateless rule definition's match attributes. You must
* specify a standard action (aws:pass
, aws:drop
, or aws:forward_to_sfe
). You
* can then add custom actions.
*
*
* @param actions
* The actions to take on a packet that matches one of the stateless rule definition's match attributes. You
* must specify a standard action (aws:pass
, aws:drop
, or
* aws:forward_to_sfe
). You can then add custom actions.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RuleGroupSourceStatelessRuleDefinition withActions(java.util.Collection actions) {
setActions(actions);
return this;
}
/**
*
* The criteria for Network Firewall to use to inspect an individual packet in a stateless rule inspection.
*
*
* @param matchAttributes
* The criteria for Network Firewall to use to inspect an individual packet in a stateless rule inspection.
*/
public void setMatchAttributes(RuleGroupSourceStatelessRuleMatchAttributes matchAttributes) {
this.matchAttributes = matchAttributes;
}
/**
*
* The criteria for Network Firewall to use to inspect an individual packet in a stateless rule inspection.
*
*
* @return The criteria for Network Firewall to use to inspect an individual packet in a stateless rule inspection.
*/
public RuleGroupSourceStatelessRuleMatchAttributes getMatchAttributes() {
return this.matchAttributes;
}
/**
*
* The criteria for Network Firewall to use to inspect an individual packet in a stateless rule inspection.
*
*
* @param matchAttributes
* The criteria for Network Firewall to use to inspect an individual packet in a stateless rule inspection.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public RuleGroupSourceStatelessRuleDefinition withMatchAttributes(RuleGroupSourceStatelessRuleMatchAttributes matchAttributes) {
setMatchAttributes(matchAttributes);
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 (getActions() != null)
sb.append("Actions: ").append(getActions()).append(",");
if (getMatchAttributes() != null)
sb.append("MatchAttributes: ").append(getMatchAttributes());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof RuleGroupSourceStatelessRuleDefinition == false)
return false;
RuleGroupSourceStatelessRuleDefinition other = (RuleGroupSourceStatelessRuleDefinition) obj;
if (other.getActions() == null ^ this.getActions() == null)
return false;
if (other.getActions() != null && other.getActions().equals(this.getActions()) == false)
return false;
if (other.getMatchAttributes() == null ^ this.getMatchAttributes() == null)
return false;
if (other.getMatchAttributes() != null && other.getMatchAttributes().equals(this.getMatchAttributes()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getActions() == null) ? 0 : getActions().hashCode());
hashCode = prime * hashCode + ((getMatchAttributes() == null) ? 0 : getMatchAttributes().hashCode());
return hashCode;
}
@Override
public RuleGroupSourceStatelessRuleDefinition clone() {
try {
return (RuleGroupSourceStatelessRuleDefinition) 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.securityhub.model.transform.RuleGroupSourceStatelessRuleDefinitionMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}