software.amazon.awssdk.services.costexplorer.model.ElastiCacheInstanceDetails Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of costexplorer Show documentation
Show all versions of costexplorer Show documentation
The AWS Java SDK for AWS Cost Explorer module holds the client classes that are used for communicating
with AWS Cost Explorer Service
/*
* 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.costexplorer.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;
/**
*
* Details about the Amazon ElastiCache reservations that Amazon Web Services recommends that you purchase.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class ElastiCacheInstanceDetails implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField FAMILY_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Family")
.getter(getter(ElastiCacheInstanceDetails::family)).setter(setter(Builder::family))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Family").build()).build();
private static final SdkField NODE_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("NodeType").getter(getter(ElastiCacheInstanceDetails::nodeType)).setter(setter(Builder::nodeType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NodeType").build()).build();
private static final SdkField REGION_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Region")
.getter(getter(ElastiCacheInstanceDetails::region)).setter(setter(Builder::region))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Region").build()).build();
private static final SdkField PRODUCT_DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ProductDescription").getter(getter(ElastiCacheInstanceDetails::productDescription))
.setter(setter(Builder::productDescription))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ProductDescription").build())
.build();
private static final SdkField CURRENT_GENERATION_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("CurrentGeneration").getter(getter(ElastiCacheInstanceDetails::currentGeneration))
.setter(setter(Builder::currentGeneration))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CurrentGeneration").build()).build();
private static final SdkField SIZE_FLEX_ELIGIBLE_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("SizeFlexEligible").getter(getter(ElastiCacheInstanceDetails::sizeFlexEligible))
.setter(setter(Builder::sizeFlexEligible))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SizeFlexEligible").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(FAMILY_FIELD, NODE_TYPE_FIELD,
REGION_FIELD, PRODUCT_DESCRIPTION_FIELD, CURRENT_GENERATION_FIELD, SIZE_FLEX_ELIGIBLE_FIELD));
private static final long serialVersionUID = 1L;
private final String family;
private final String nodeType;
private final String region;
private final String productDescription;
private final Boolean currentGeneration;
private final Boolean sizeFlexEligible;
private ElastiCacheInstanceDetails(BuilderImpl builder) {
this.family = builder.family;
this.nodeType = builder.nodeType;
this.region = builder.region;
this.productDescription = builder.productDescription;
this.currentGeneration = builder.currentGeneration;
this.sizeFlexEligible = builder.sizeFlexEligible;
}
/**
*
* The instance family of the recommended reservation.
*
*
* @return The instance family of the recommended reservation.
*/
public final String family() {
return family;
}
/**
*
* The type of node that Amazon Web Services recommends.
*
*
* @return The type of node that Amazon Web Services recommends.
*/
public final String nodeType() {
return nodeType;
}
/**
*
* The Amazon Web Services Region of the recommended reservation.
*
*
* @return The Amazon Web Services Region of the recommended reservation.
*/
public final String region() {
return region;
}
/**
*
* The description of the recommended reservation.
*
*
* @return The description of the recommended reservation.
*/
public final String productDescription() {
return productDescription;
}
/**
*
* Determines whether the recommendation is for a current generation instance.
*
*
* @return Determines whether the recommendation is for a current generation instance.
*/
public final Boolean currentGeneration() {
return currentGeneration;
}
/**
*
* Determines whether the recommended reservation is size flexible.
*
*
* @return Determines whether the recommended reservation is size flexible.
*/
public final Boolean sizeFlexEligible() {
return sizeFlexEligible;
}
@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(family());
hashCode = 31 * hashCode + Objects.hashCode(nodeType());
hashCode = 31 * hashCode + Objects.hashCode(region());
hashCode = 31 * hashCode + Objects.hashCode(productDescription());
hashCode = 31 * hashCode + Objects.hashCode(currentGeneration());
hashCode = 31 * hashCode + Objects.hashCode(sizeFlexEligible());
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 ElastiCacheInstanceDetails)) {
return false;
}
ElastiCacheInstanceDetails other = (ElastiCacheInstanceDetails) obj;
return Objects.equals(family(), other.family()) && Objects.equals(nodeType(), other.nodeType())
&& Objects.equals(region(), other.region()) && Objects.equals(productDescription(), other.productDescription())
&& Objects.equals(currentGeneration(), other.currentGeneration())
&& Objects.equals(sizeFlexEligible(), other.sizeFlexEligible());
}
/**
* 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("ElastiCacheInstanceDetails").add("Family", family()).add("NodeType", nodeType())
.add("Region", region()).add("ProductDescription", productDescription())
.add("CurrentGeneration", currentGeneration()).add("SizeFlexEligible", sizeFlexEligible()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "Family":
return Optional.ofNullable(clazz.cast(family()));
case "NodeType":
return Optional.ofNullable(clazz.cast(nodeType()));
case "Region":
return Optional.ofNullable(clazz.cast(region()));
case "ProductDescription":
return Optional.ofNullable(clazz.cast(productDescription()));
case "CurrentGeneration":
return Optional.ofNullable(clazz.cast(currentGeneration()));
case "SizeFlexEligible":
return Optional.ofNullable(clazz.cast(sizeFlexEligible()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function
© 2015 - 2025 Weber Informatics LLC | Privacy Policy