software.amazon.awssdk.services.redshift.model.OrderableClusterOption Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of redshift Show documentation
Show all versions of redshift Show documentation
The AWS Java SDK for Amazon Redshift module holds the client classes that are used for communicating
with Amazon Redshift Service
/*
* Copyright 2014-2019 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.redshift.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collection;
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 java.util.stream.Collectors;
import java.util.stream.Stream;
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.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* Describes an orderable cluster option.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class OrderableClusterOption implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField CLUSTER_VERSION_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(OrderableClusterOption::clusterVersion)).setter(setter(Builder::clusterVersion))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ClusterVersion").build()).build();
private static final SdkField CLUSTER_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(OrderableClusterOption::clusterType)).setter(setter(Builder::clusterType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ClusterType").build()).build();
private static final SdkField NODE_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(OrderableClusterOption::nodeType)).setter(setter(Builder::nodeType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NodeType").build()).build();
private static final SdkField> AVAILABILITY_ZONES_FIELD = SdkField
.> builder(MarshallingType.LIST)
.getter(getter(OrderableClusterOption::availabilityZones))
.setter(setter(Builder::availabilityZones))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AvailabilityZones").build(),
ListTrait
.builder()
.memberLocationName("AvailabilityZone")
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(AvailabilityZone::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("AvailabilityZone").build()).build()).build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CLUSTER_VERSION_FIELD,
CLUSTER_TYPE_FIELD, NODE_TYPE_FIELD, AVAILABILITY_ZONES_FIELD));
private static final long serialVersionUID = 1L;
private final String clusterVersion;
private final String clusterType;
private final String nodeType;
private final List availabilityZones;
private OrderableClusterOption(BuilderImpl builder) {
this.clusterVersion = builder.clusterVersion;
this.clusterType = builder.clusterType;
this.nodeType = builder.nodeType;
this.availabilityZones = builder.availabilityZones;
}
/**
*
* The version of the orderable cluster.
*
*
* @return The version of the orderable cluster.
*/
public String clusterVersion() {
return clusterVersion;
}
/**
*
* The cluster type, for example multi-node
.
*
*
* @return The cluster type, for example multi-node
.
*/
public String clusterType() {
return clusterType;
}
/**
*
* The node type for the orderable cluster.
*
*
* @return The node type for the orderable cluster.
*/
public String nodeType() {
return nodeType;
}
/**
*
* A list of availability zones for the orderable cluster.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* @return A list of availability zones for the orderable cluster.
*/
public List availabilityZones() {
return availabilityZones;
}
@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 int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(clusterVersion());
hashCode = 31 * hashCode + Objects.hashCode(clusterType());
hashCode = 31 * hashCode + Objects.hashCode(nodeType());
hashCode = 31 * hashCode + Objects.hashCode(availabilityZones());
return hashCode;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof OrderableClusterOption)) {
return false;
}
OrderableClusterOption other = (OrderableClusterOption) obj;
return Objects.equals(clusterVersion(), other.clusterVersion()) && Objects.equals(clusterType(), other.clusterType())
&& Objects.equals(nodeType(), other.nodeType()) && Objects.equals(availabilityZones(), other.availabilityZones());
}
/**
* 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 String toString() {
return ToString.builder("OrderableClusterOption").add("ClusterVersion", clusterVersion())
.add("ClusterType", clusterType()).add("NodeType", nodeType()).add("AvailabilityZones", availabilityZones())
.build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "ClusterVersion":
return Optional.ofNullable(clazz.cast(clusterVersion()));
case "ClusterType":
return Optional.ofNullable(clazz.cast(clusterType()));
case "NodeType":
return Optional.ofNullable(clazz.cast(nodeType()));
case "AvailabilityZones":
return Optional.ofNullable(clazz.cast(availabilityZones()));
default:
return Optional.empty();
}
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
private static Function
© 2015 - 2025 Weber Informatics LLC | Privacy Policy