All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.securityhub.model.AwsDynamoDbTableStreamSpecification 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.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;

/**
 * 

* The current DynamoDB Streams configuration for the table. *

*/ @Generated("software.amazon.awssdk:codegen") public final class AwsDynamoDbTableStreamSpecification implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField STREAM_ENABLED_FIELD = SdkField. builder(MarshallingType.BOOLEAN) .memberName("StreamEnabled").getter(getter(AwsDynamoDbTableStreamSpecification::streamEnabled)) .setter(setter(Builder::streamEnabled)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StreamEnabled").build()).build(); private static final SdkField STREAM_VIEW_TYPE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("StreamViewType").getter(getter(AwsDynamoDbTableStreamSpecification::streamViewType)) .setter(setter(Builder::streamViewType)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StreamViewType").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(STREAM_ENABLED_FIELD, STREAM_VIEW_TYPE_FIELD)); private static final long serialVersionUID = 1L; private final Boolean streamEnabled; private final String streamViewType; private AwsDynamoDbTableStreamSpecification(BuilderImpl builder) { this.streamEnabled = builder.streamEnabled; this.streamViewType = builder.streamViewType; } /** *

* Indicates whether DynamoDB Streams is enabled on the table. *

* * @return Indicates whether DynamoDB Streams is enabled on the table. */ public final Boolean streamEnabled() { return streamEnabled; } /** *

* Determines the information that is written to the table. *

* * @return Determines the information that is written to the table. */ public final String streamViewType() { return streamViewType; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(streamEnabled()); hashCode = 31 * hashCode + Objects.hashCode(streamViewType()); 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 AwsDynamoDbTableStreamSpecification)) { return false; } AwsDynamoDbTableStreamSpecification other = (AwsDynamoDbTableStreamSpecification) obj; return Objects.equals(streamEnabled(), other.streamEnabled()) && Objects.equals(streamViewType(), other.streamViewType()); } /** * 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("AwsDynamoDbTableStreamSpecification").add("StreamEnabled", streamEnabled()) .add("StreamViewType", streamViewType()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "StreamEnabled": return Optional.ofNullable(clazz.cast(streamEnabled())); case "StreamViewType": return Optional.ofNullable(clazz.cast(streamViewType())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((AwsDynamoDbTableStreamSpecification) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* Indicates whether DynamoDB Streams is enabled on the table. *

* * @param streamEnabled * Indicates whether DynamoDB Streams is enabled on the table. * @return Returns a reference to this object so that method calls can be chained together. */ Builder streamEnabled(Boolean streamEnabled); /** *

* Determines the information that is written to the table. *

* * @param streamViewType * Determines the information that is written to the table. * @return Returns a reference to this object so that method calls can be chained together. */ Builder streamViewType(String streamViewType); } static final class BuilderImpl implements Builder { private Boolean streamEnabled; private String streamViewType; private BuilderImpl() { } private BuilderImpl(AwsDynamoDbTableStreamSpecification model) { streamEnabled(model.streamEnabled); streamViewType(model.streamViewType); } public final Boolean getStreamEnabled() { return streamEnabled; } public final void setStreamEnabled(Boolean streamEnabled) { this.streamEnabled = streamEnabled; } @Override public final Builder streamEnabled(Boolean streamEnabled) { this.streamEnabled = streamEnabled; return this; } public final String getStreamViewType() { return streamViewType; } public final void setStreamViewType(String streamViewType) { this.streamViewType = streamViewType; } @Override public final Builder streamViewType(String streamViewType) { this.streamViewType = streamViewType; return this; } @Override public AwsDynamoDbTableStreamSpecification build() { return new AwsDynamoDbTableStreamSpecification(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy