com.amazonaws.services.networkfirewall.model.StatelessRulesAndCustomActions 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;
/**
*
* Stateless inspection criteria. Each stateless rule group uses exactly one of these data types to define its stateless
* rules.
*
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class StatelessRulesAndCustomActions implements Serializable, Cloneable, StructuredPojo {
/**
*
* Defines the set of stateless rules for use in a stateless rule group.
*
*/
private java.util.List statelessRules;
/**
*
* Defines an array of individual custom action definitions that are available for use by the stateless rules in
* this StatelessRulesAndCustomActions
specification. You name each custom action that you define, and
* then you can use it by name in your StatelessRule RuleDefinition Actions
* specification.
*
*/
private java.util.List customActions;
/**
*
* Defines the set of stateless rules for use in a stateless rule group.
*
*
* @return Defines the set of stateless rules for use in a stateless rule group.
*/
public java.util.List getStatelessRules() {
return statelessRules;
}
/**
*
* Defines the set of stateless rules for use in a stateless rule group.
*
*
* @param statelessRules
* Defines the set of stateless rules for use in a stateless rule group.
*/
public void setStatelessRules(java.util.Collection statelessRules) {
if (statelessRules == null) {
this.statelessRules = null;
return;
}
this.statelessRules = new java.util.ArrayList(statelessRules);
}
/**
*
* Defines the set of stateless rules for use in a stateless rule group.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setStatelessRules(java.util.Collection)} or {@link #withStatelessRules(java.util.Collection)} if you want
* to override the existing values.
*
*
* @param statelessRules
* Defines the set of stateless rules for use in a stateless rule group.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public StatelessRulesAndCustomActions withStatelessRules(StatelessRule... statelessRules) {
if (this.statelessRules == null) {
setStatelessRules(new java.util.ArrayList(statelessRules.length));
}
for (StatelessRule ele : statelessRules) {
this.statelessRules.add(ele);
}
return this;
}
/**
*
* Defines the set of stateless rules for use in a stateless rule group.
*
*
* @param statelessRules
* Defines the set of stateless rules for use in a stateless rule group.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public StatelessRulesAndCustomActions withStatelessRules(java.util.Collection statelessRules) {
setStatelessRules(statelessRules);
return this;
}
/**
*
* Defines an array of individual custom action definitions that are available for use by the stateless rules in
* this StatelessRulesAndCustomActions
specification. You name each custom action that you define, and
* then you can use it by name in your StatelessRule RuleDefinition Actions
* specification.
*
*
* @return Defines an array of individual custom action definitions that are available for use by the stateless
* rules in this StatelessRulesAndCustomActions
specification. You name each custom action that
* you define, and then you can use it by name in your StatelessRule RuleDefinition
* Actions
specification.
*/
public java.util.List getCustomActions() {
return customActions;
}
/**
*
* Defines an array of individual custom action definitions that are available for use by the stateless rules in
* this StatelessRulesAndCustomActions
specification. You name each custom action that you define, and
* then you can use it by name in your StatelessRule RuleDefinition Actions
* specification.
*
*
* @param customActions
* Defines an array of individual custom action definitions that are available for use by the stateless rules
* in this StatelessRulesAndCustomActions
specification. You name each custom action that you
* define, and then you can use it by name in your StatelessRule RuleDefinition
* Actions
specification.
*/
public void setCustomActions(java.util.Collection customActions) {
if (customActions == null) {
this.customActions = null;
return;
}
this.customActions = new java.util.ArrayList(customActions);
}
/**
*
* Defines an array of individual custom action definitions that are available for use by the stateless rules in
* this StatelessRulesAndCustomActions
specification. You name each custom action that you define, and
* then you can use it by name in your StatelessRule RuleDefinition Actions
* specification.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setCustomActions(java.util.Collection)} or {@link #withCustomActions(java.util.Collection)} if you want
* to override the existing values.
*
*
* @param customActions
* Defines an array of individual custom action definitions that are available for use by the stateless rules
* in this StatelessRulesAndCustomActions
specification. You name each custom action that you
* define, and then you can use it by name in your StatelessRule RuleDefinition
* Actions
specification.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public StatelessRulesAndCustomActions withCustomActions(CustomAction... customActions) {
if (this.customActions == null) {
setCustomActions(new java.util.ArrayList(customActions.length));
}
for (CustomAction ele : customActions) {
this.customActions.add(ele);
}
return this;
}
/**
*
* Defines an array of individual custom action definitions that are available for use by the stateless rules in
* this StatelessRulesAndCustomActions
specification. You name each custom action that you define, and
* then you can use it by name in your StatelessRule RuleDefinition Actions
* specification.
*
*
* @param customActions
* Defines an array of individual custom action definitions that are available for use by the stateless rules
* in this StatelessRulesAndCustomActions
specification. You name each custom action that you
* define, and then you can use it by name in your StatelessRule RuleDefinition
* Actions
specification.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public StatelessRulesAndCustomActions withCustomActions(java.util.Collection customActions) {
setCustomActions(customActions);
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 (getStatelessRules() != null)
sb.append("StatelessRules: ").append(getStatelessRules()).append(",");
if (getCustomActions() != null)
sb.append("CustomActions: ").append(getCustomActions());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof StatelessRulesAndCustomActions == false)
return false;
StatelessRulesAndCustomActions other = (StatelessRulesAndCustomActions) obj;
if (other.getStatelessRules() == null ^ this.getStatelessRules() == null)
return false;
if (other.getStatelessRules() != null && other.getStatelessRules().equals(this.getStatelessRules()) == false)
return false;
if (other.getCustomActions() == null ^ this.getCustomActions() == null)
return false;
if (other.getCustomActions() != null && other.getCustomActions().equals(this.getCustomActions()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getStatelessRules() == null) ? 0 : getStatelessRules().hashCode());
hashCode = prime * hashCode + ((getCustomActions() == null) ? 0 : getCustomActions().hashCode());
return hashCode;
}
@Override
public StatelessRulesAndCustomActions clone() {
try {
return (StatelessRulesAndCustomActions) 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.StatelessRulesAndCustomActionsMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}