software.amazon.awssdk.services.rds.model.RdsCustomClusterConfiguration Maven / Gradle / Ivy
Show all versions of rds Show documentation
/*
* 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.rds.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;
/**
*
* Reserved for future use.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class RdsCustomClusterConfiguration implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField INTERCONNECT_SUBNET_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("InterconnectSubnetId").getter(getter(RdsCustomClusterConfiguration::interconnectSubnetId))
.setter(setter(Builder::interconnectSubnetId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("InterconnectSubnetId").build())
.build();
private static final SdkField TRANSIT_GATEWAY_MULTICAST_DOMAIN_ID_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("TransitGatewayMulticastDomainId")
.getter(getter(RdsCustomClusterConfiguration::transitGatewayMulticastDomainId))
.setter(setter(Builder::transitGatewayMulticastDomainId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TransitGatewayMulticastDomainId")
.build()).build();
private static final SdkField REPLICA_MODE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ReplicaMode").getter(getter(RdsCustomClusterConfiguration::replicaModeAsString))
.setter(setter(Builder::replicaMode))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ReplicaMode").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(INTERCONNECT_SUBNET_ID_FIELD,
TRANSIT_GATEWAY_MULTICAST_DOMAIN_ID_FIELD, REPLICA_MODE_FIELD));
private static final long serialVersionUID = 1L;
private final String interconnectSubnetId;
private final String transitGatewayMulticastDomainId;
private final String replicaMode;
private RdsCustomClusterConfiguration(BuilderImpl builder) {
this.interconnectSubnetId = builder.interconnectSubnetId;
this.transitGatewayMulticastDomainId = builder.transitGatewayMulticastDomainId;
this.replicaMode = builder.replicaMode;
}
/**
*
* Reserved for future use.
*
*
* @return Reserved for future use.
*/
public final String interconnectSubnetId() {
return interconnectSubnetId;
}
/**
*
* Reserved for future use.
*
*
* @return Reserved for future use.
*/
public final String transitGatewayMulticastDomainId() {
return transitGatewayMulticastDomainId;
}
/**
*
* Reserved for future use.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #replicaMode} will
* return {@link ReplicaMode#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #replicaModeAsString}.
*
*
* @return Reserved for future use.
* @see ReplicaMode
*/
public final ReplicaMode replicaMode() {
return ReplicaMode.fromValue(replicaMode);
}
/**
*
* Reserved for future use.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #replicaMode} will
* return {@link ReplicaMode#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #replicaModeAsString}.
*
*
* @return Reserved for future use.
* @see ReplicaMode
*/
public final String replicaModeAsString() {
return replicaMode;
}
@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(interconnectSubnetId());
hashCode = 31 * hashCode + Objects.hashCode(transitGatewayMulticastDomainId());
hashCode = 31 * hashCode + Objects.hashCode(replicaModeAsString());
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 RdsCustomClusterConfiguration)) {
return false;
}
RdsCustomClusterConfiguration other = (RdsCustomClusterConfiguration) obj;
return Objects.equals(interconnectSubnetId(), other.interconnectSubnetId())
&& Objects.equals(transitGatewayMulticastDomainId(), other.transitGatewayMulticastDomainId())
&& Objects.equals(replicaModeAsString(), other.replicaModeAsString());
}
/**
* 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("RdsCustomClusterConfiguration").add("InterconnectSubnetId", interconnectSubnetId())
.add("TransitGatewayMulticastDomainId", transitGatewayMulticastDomainId())
.add("ReplicaMode", replicaModeAsString()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "InterconnectSubnetId":
return Optional.ofNullable(clazz.cast(interconnectSubnetId()));
case "TransitGatewayMulticastDomainId":
return Optional.ofNullable(clazz.cast(transitGatewayMulticastDomainId()));
case "ReplicaMode":
return Optional.ofNullable(clazz.cast(replicaModeAsString()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function