software.amazon.awssdk.services.fms.model.PolicyOption Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fms Show documentation
Show all versions of fms Show documentation
The AWS Java SDK for FMS module holds the client classes that are used for
communicating with FMS.
/*
* 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.fms.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
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;
/**
*
* Contains the settings to configure a network ACL policy, a Network Firewall firewall policy deployment model, or a
* third-party firewall policy.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class PolicyOption implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField NETWORK_FIREWALL_POLICY_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("NetworkFirewallPolicy")
.getter(getter(PolicyOption::networkFirewallPolicy)).setter(setter(Builder::networkFirewallPolicy))
.constructor(NetworkFirewallPolicy::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NetworkFirewallPolicy").build())
.build();
private static final SdkField THIRD_PARTY_FIREWALL_POLICY_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("ThirdPartyFirewallPolicy")
.getter(getter(PolicyOption::thirdPartyFirewallPolicy)).setter(setter(Builder::thirdPartyFirewallPolicy))
.constructor(ThirdPartyFirewallPolicy::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ThirdPartyFirewallPolicy").build())
.build();
private static final SdkField NETWORK_ACL_COMMON_POLICY_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("NetworkAclCommonPolicy")
.getter(getter(PolicyOption::networkAclCommonPolicy)).setter(setter(Builder::networkAclCommonPolicy))
.constructor(NetworkAclCommonPolicy::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NetworkAclCommonPolicy").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(NETWORK_FIREWALL_POLICY_FIELD,
THIRD_PARTY_FIREWALL_POLICY_FIELD, NETWORK_ACL_COMMON_POLICY_FIELD));
private static final Map> SDK_NAME_TO_FIELD = Collections
.unmodifiableMap(new HashMap>() {
{
put("NetworkFirewallPolicy", NETWORK_FIREWALL_POLICY_FIELD);
put("ThirdPartyFirewallPolicy", THIRD_PARTY_FIREWALL_POLICY_FIELD);
put("NetworkAclCommonPolicy", NETWORK_ACL_COMMON_POLICY_FIELD);
}
});
private static final long serialVersionUID = 1L;
private final NetworkFirewallPolicy networkFirewallPolicy;
private final ThirdPartyFirewallPolicy thirdPartyFirewallPolicy;
private final NetworkAclCommonPolicy networkAclCommonPolicy;
private PolicyOption(BuilderImpl builder) {
this.networkFirewallPolicy = builder.networkFirewallPolicy;
this.thirdPartyFirewallPolicy = builder.thirdPartyFirewallPolicy;
this.networkAclCommonPolicy = builder.networkAclCommonPolicy;
}
/**
*
* Defines the deployment model to use for the firewall policy.
*
*
* @return Defines the deployment model to use for the firewall policy.
*/
public final NetworkFirewallPolicy networkFirewallPolicy() {
return networkFirewallPolicy;
}
/**
*
* Defines the policy options for a third-party firewall policy.
*
*
* @return Defines the policy options for a third-party firewall policy.
*/
public final ThirdPartyFirewallPolicy thirdPartyFirewallPolicy() {
return thirdPartyFirewallPolicy;
}
/**
*
* Defines a Firewall Manager network ACL policy.
*
*
* @return Defines a Firewall Manager network ACL policy.
*/
public final NetworkAclCommonPolicy networkAclCommonPolicy() {
return networkAclCommonPolicy;
}
@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(networkFirewallPolicy());
hashCode = 31 * hashCode + Objects.hashCode(thirdPartyFirewallPolicy());
hashCode = 31 * hashCode + Objects.hashCode(networkAclCommonPolicy());
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 PolicyOption)) {
return false;
}
PolicyOption other = (PolicyOption) obj;
return Objects.equals(networkFirewallPolicy(), other.networkFirewallPolicy())
&& Objects.equals(thirdPartyFirewallPolicy(), other.thirdPartyFirewallPolicy())
&& Objects.equals(networkAclCommonPolicy(), other.networkAclCommonPolicy());
}
/**
* 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("PolicyOption").add("NetworkFirewallPolicy", networkFirewallPolicy())
.add("ThirdPartyFirewallPolicy", thirdPartyFirewallPolicy())
.add("NetworkAclCommonPolicy", networkAclCommonPolicy()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "NetworkFirewallPolicy":
return Optional.ofNullable(clazz.cast(networkFirewallPolicy()));
case "ThirdPartyFirewallPolicy":
return Optional.ofNullable(clazz.cast(thirdPartyFirewallPolicy()));
case "NetworkAclCommonPolicy":
return Optional.ofNullable(clazz.cast(networkAclCommonPolicy()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
@Override
public final Map> sdkFieldNameToField() {
return SDK_NAME_TO_FIELD;
}
private static Function
© 2015 - 2025 Weber Informatics LLC | Privacy Policy