
software.amazon.awssdk.services.securityhub.model.AwsNetworkFirewallRuleGroupDetails Maven / Gradle / Ivy
/*
* Copyright 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 software.amazon.awssdk.services.securityhub.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* Details about an Network Firewall rule group. Rule groups are used to inspect and control network traffic. Stateless
* rule groups apply to individual packets. Stateful rule groups apply to packets in the context of their traffic flow.
*
*
* Rule groups are referenced in firewall policies.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class AwsNetworkFirewallRuleGroupDetails implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField CAPACITY_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("Capacity").getter(getter(AwsNetworkFirewallRuleGroupDetails::capacity))
.setter(setter(Builder::capacity))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Capacity").build()).build();
private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("Description").getter(getter(AwsNetworkFirewallRuleGroupDetails::description))
.setter(setter(Builder::description))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Description").build()).build();
private static final SdkField RULE_GROUP_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("RuleGroup")
.getter(getter(AwsNetworkFirewallRuleGroupDetails::ruleGroup)).setter(setter(Builder::ruleGroup))
.constructor(RuleGroupDetails::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RuleGroup").build()).build();
private static final SdkField RULE_GROUP_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("RuleGroupArn").getter(getter(AwsNetworkFirewallRuleGroupDetails::ruleGroupArn))
.setter(setter(Builder::ruleGroupArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RuleGroupArn").build()).build();
private static final SdkField RULE_GROUP_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("RuleGroupId").getter(getter(AwsNetworkFirewallRuleGroupDetails::ruleGroupId))
.setter(setter(Builder::ruleGroupId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RuleGroupId").build()).build();
private static final SdkField RULE_GROUP_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("RuleGroupName").getter(getter(AwsNetworkFirewallRuleGroupDetails::ruleGroupName))
.setter(setter(Builder::ruleGroupName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RuleGroupName").build()).build();
private static final SdkField TYPE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Type")
.getter(getter(AwsNetworkFirewallRuleGroupDetails::type)).setter(setter(Builder::type))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Type").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CAPACITY_FIELD,
DESCRIPTION_FIELD, RULE_GROUP_FIELD, RULE_GROUP_ARN_FIELD, RULE_GROUP_ID_FIELD, RULE_GROUP_NAME_FIELD, TYPE_FIELD));
private static final long serialVersionUID = 1L;
private final Integer capacity;
private final String description;
private final RuleGroupDetails ruleGroup;
private final String ruleGroupArn;
private final String ruleGroupId;
private final String ruleGroupName;
private final String type;
private AwsNetworkFirewallRuleGroupDetails(BuilderImpl builder) {
this.capacity = builder.capacity;
this.description = builder.description;
this.ruleGroup = builder.ruleGroup;
this.ruleGroupArn = builder.ruleGroupArn;
this.ruleGroupId = builder.ruleGroupId;
this.ruleGroupName = builder.ruleGroupName;
this.type = builder.type;
}
/**
*
* The maximum number of operating resources that this rule group can use.
*
*
* @return The maximum number of operating resources that this rule group can use.
*/
public final Integer capacity() {
return capacity;
}
/**
*
* A description of the rule group.
*
*
* @return A description of the rule group.
*/
public final String description() {
return description;
}
/**
*
* Details about the rule group.
*
*
* @return Details about the rule group.
*/
public final RuleGroupDetails ruleGroup() {
return ruleGroup;
}
/**
*
* The ARN of the rule group.
*
*
* @return The ARN of the rule group.
*/
public final String ruleGroupArn() {
return ruleGroupArn;
}
/**
*
* The identifier of the rule group.
*
*
* @return The identifier of the rule group.
*/
public final String ruleGroupId() {
return ruleGroupId;
}
/**
*
* The descriptive name of the rule group.
*
*
* @return The descriptive name of the rule group.
*/
public final String ruleGroupName() {
return ruleGroupName;
}
/**
*
* The type of rule group. A rule group can be stateful or stateless.
*
*
* @return The type of rule group. A rule group can be stateful or stateless.
*/
public final String type() {
return type;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(capacity());
hashCode = 31 * hashCode + Objects.hashCode(description());
hashCode = 31 * hashCode + Objects.hashCode(ruleGroup());
hashCode = 31 * hashCode + Objects.hashCode(ruleGroupArn());
hashCode = 31 * hashCode + Objects.hashCode(ruleGroupId());
hashCode = 31 * hashCode + Objects.hashCode(ruleGroupName());
hashCode = 31 * hashCode + Objects.hashCode(type());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof AwsNetworkFirewallRuleGroupDetails)) {
return false;
}
AwsNetworkFirewallRuleGroupDetails other = (AwsNetworkFirewallRuleGroupDetails) obj;
return Objects.equals(capacity(), other.capacity()) && Objects.equals(description(), other.description())
&& Objects.equals(ruleGroup(), other.ruleGroup()) && Objects.equals(ruleGroupArn(), other.ruleGroupArn())
&& Objects.equals(ruleGroupId(), other.ruleGroupId()) && Objects.equals(ruleGroupName(), other.ruleGroupName())
&& Objects.equals(type(), other.type());
}
/**
* 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.
*/
@Override
public final String toString() {
return ToString.builder("AwsNetworkFirewallRuleGroupDetails").add("Capacity", capacity())
.add("Description", description()).add("RuleGroup", ruleGroup()).add("RuleGroupArn", ruleGroupArn())
.add("RuleGroupId", ruleGroupId()).add("RuleGroupName", ruleGroupName()).add("Type", type()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "Capacity":
return Optional.ofNullable(clazz.cast(capacity()));
case "Description":
return Optional.ofNullable(clazz.cast(description()));
case "RuleGroup":
return Optional.ofNullable(clazz.cast(ruleGroup()));
case "RuleGroupArn":
return Optional.ofNullable(clazz.cast(ruleGroupArn()));
case "RuleGroupId":
return Optional.ofNullable(clazz.cast(ruleGroupId()));
case "RuleGroupName":
return Optional.ofNullable(clazz.cast(ruleGroupName()));
case "Type":
return Optional.ofNullable(clazz.cast(type()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function
© 2015 - 2025 Weber Informatics LLC | Privacy Policy