
software.amazon.awssdk.services.dynamodb.model.KinesisDataStreamDestination 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.dynamodb.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;
/**
*
* Describes a Kinesis data stream destination.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class KinesisDataStreamDestination implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField STREAM_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("StreamArn").getter(getter(KinesisDataStreamDestination::streamArn)).setter(setter(Builder::streamArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StreamArn").build()).build();
private static final SdkField DESTINATION_STATUS_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DestinationStatus").getter(getter(KinesisDataStreamDestination::destinationStatusAsString))
.setter(setter(Builder::destinationStatus))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DestinationStatus").build()).build();
private static final SdkField DESTINATION_STATUS_DESCRIPTION_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("DestinationStatusDescription")
.getter(getter(KinesisDataStreamDestination::destinationStatusDescription))
.setter(setter(Builder::destinationStatusDescription))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DestinationStatusDescription")
.build()).build();
private static final SdkField APPROXIMATE_CREATION_DATE_TIME_PRECISION_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("ApproximateCreationDateTimePrecision")
.getter(getter(KinesisDataStreamDestination::approximateCreationDateTimePrecisionAsString))
.setter(setter(Builder::approximateCreationDateTimePrecision))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("ApproximateCreationDateTimePrecision").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(STREAM_ARN_FIELD,
DESTINATION_STATUS_FIELD, DESTINATION_STATUS_DESCRIPTION_FIELD, APPROXIMATE_CREATION_DATE_TIME_PRECISION_FIELD));
private static final long serialVersionUID = 1L;
private final String streamArn;
private final String destinationStatus;
private final String destinationStatusDescription;
private final String approximateCreationDateTimePrecision;
private KinesisDataStreamDestination(BuilderImpl builder) {
this.streamArn = builder.streamArn;
this.destinationStatus = builder.destinationStatus;
this.destinationStatusDescription = builder.destinationStatusDescription;
this.approximateCreationDateTimePrecision = builder.approximateCreationDateTimePrecision;
}
/**
*
* The ARN for a specific Kinesis data stream.
*
*
* @return The ARN for a specific Kinesis data stream.
*/
public final String streamArn() {
return streamArn;
}
/**
*
* The current status of replication.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #destinationStatus}
* will return {@link DestinationStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #destinationStatusAsString}.
*
*
* @return The current status of replication.
* @see DestinationStatus
*/
public final DestinationStatus destinationStatus() {
return DestinationStatus.fromValue(destinationStatus);
}
/**
*
* The current status of replication.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #destinationStatus}
* will return {@link DestinationStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #destinationStatusAsString}.
*
*
* @return The current status of replication.
* @see DestinationStatus
*/
public final String destinationStatusAsString() {
return destinationStatus;
}
/**
*
* The human-readable string that corresponds to the replica status.
*
*
* @return The human-readable string that corresponds to the replica status.
*/
public final String destinationStatusDescription() {
return destinationStatusDescription;
}
/**
*
* The precision of the Kinesis data stream timestamp. The values are either MILLISECOND
or
* MICROSECOND
.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #approximateCreationDateTimePrecision} will return
* {@link ApproximateCreationDateTimePrecision#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is
* available from {@link #approximateCreationDateTimePrecisionAsString}.
*
*
* @return The precision of the Kinesis data stream timestamp. The values are either MILLISECOND
or
* MICROSECOND
.
* @see ApproximateCreationDateTimePrecision
*/
public final ApproximateCreationDateTimePrecision approximateCreationDateTimePrecision() {
return ApproximateCreationDateTimePrecision.fromValue(approximateCreationDateTimePrecision);
}
/**
*
* The precision of the Kinesis data stream timestamp. The values are either MILLISECOND
or
* MICROSECOND
.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #approximateCreationDateTimePrecision} will return
* {@link ApproximateCreationDateTimePrecision#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is
* available from {@link #approximateCreationDateTimePrecisionAsString}.
*
*
* @return The precision of the Kinesis data stream timestamp. The values are either MILLISECOND
or
* MICROSECOND
.
* @see ApproximateCreationDateTimePrecision
*/
public final String approximateCreationDateTimePrecisionAsString() {
return approximateCreationDateTimePrecision;
}
@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(streamArn());
hashCode = 31 * hashCode + Objects.hashCode(destinationStatusAsString());
hashCode = 31 * hashCode + Objects.hashCode(destinationStatusDescription());
hashCode = 31 * hashCode + Objects.hashCode(approximateCreationDateTimePrecisionAsString());
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 KinesisDataStreamDestination)) {
return false;
}
KinesisDataStreamDestination other = (KinesisDataStreamDestination) obj;
return Objects.equals(streamArn(), other.streamArn())
&& Objects.equals(destinationStatusAsString(), other.destinationStatusAsString())
&& Objects.equals(destinationStatusDescription(), other.destinationStatusDescription())
&& Objects.equals(approximateCreationDateTimePrecisionAsString(),
other.approximateCreationDateTimePrecisionAsString());
}
/**
* 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("KinesisDataStreamDestination").add("StreamArn", streamArn())
.add("DestinationStatus", destinationStatusAsString())
.add("DestinationStatusDescription", destinationStatusDescription())
.add("ApproximateCreationDateTimePrecision", approximateCreationDateTimePrecisionAsString()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "StreamArn":
return Optional.ofNullable(clazz.cast(streamArn()));
case "DestinationStatus":
return Optional.ofNullable(clazz.cast(destinationStatusAsString()));
case "DestinationStatusDescription":
return Optional.ofNullable(clazz.cast(destinationStatusDescription()));
case "ApproximateCreationDateTimePrecision":
return Optional.ofNullable(clazz.cast(approximateCreationDateTimePrecisionAsString()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function