software.amazon.awssdk.services.elasticache.model.ReservedCacheNode Maven / Gradle / Ivy
Show all versions of elasticache 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.elasticache.model;
import java.io.Serializable;
import java.time.Instant;
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.core.util.SdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* Represents the output of a PurchaseReservedCacheNodesOffering
operation.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class ReservedCacheNode implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField RESERVED_CACHE_NODE_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ReservedCacheNodeId").getter(getter(ReservedCacheNode::reservedCacheNodeId))
.setter(setter(Builder::reservedCacheNodeId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ReservedCacheNodeId").build())
.build();
private static final SdkField RESERVED_CACHE_NODES_OFFERING_ID_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("ReservedCacheNodesOfferingId")
.getter(getter(ReservedCacheNode::reservedCacheNodesOfferingId))
.setter(setter(Builder::reservedCacheNodesOfferingId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ReservedCacheNodesOfferingId")
.build()).build();
private static final SdkField CACHE_NODE_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("CacheNodeType").getter(getter(ReservedCacheNode::cacheNodeType)).setter(setter(Builder::cacheNodeType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CacheNodeType").build()).build();
private static final SdkField START_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("StartTime").getter(getter(ReservedCacheNode::startTime)).setter(setter(Builder::startTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StartTime").build()).build();
private static final SdkField DURATION_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("Duration").getter(getter(ReservedCacheNode::duration)).setter(setter(Builder::duration))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Duration").build()).build();
private static final SdkField FIXED_PRICE_FIELD = SdkField. builder(MarshallingType.DOUBLE)
.memberName("FixedPrice").getter(getter(ReservedCacheNode::fixedPrice)).setter(setter(Builder::fixedPrice))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FixedPrice").build()).build();
private static final SdkField USAGE_PRICE_FIELD = SdkField. builder(MarshallingType.DOUBLE)
.memberName("UsagePrice").getter(getter(ReservedCacheNode::usagePrice)).setter(setter(Builder::usagePrice))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("UsagePrice").build()).build();
private static final SdkField CACHE_NODE_COUNT_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("CacheNodeCount").getter(getter(ReservedCacheNode::cacheNodeCount))
.setter(setter(Builder::cacheNodeCount))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CacheNodeCount").build()).build();
private static final SdkField PRODUCT_DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ProductDescription").getter(getter(ReservedCacheNode::productDescription))
.setter(setter(Builder::productDescription))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ProductDescription").build())
.build();
private static final SdkField OFFERING_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("OfferingType").getter(getter(ReservedCacheNode::offeringType)).setter(setter(Builder::offeringType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OfferingType").build()).build();
private static final SdkField STATE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("State")
.getter(getter(ReservedCacheNode::state)).setter(setter(Builder::state))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("State").build()).build();
private static final SdkField> RECURRING_CHARGES_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("RecurringCharges")
.getter(getter(ReservedCacheNode::recurringCharges))
.setter(setter(Builder::recurringCharges))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RecurringCharges").build(),
ListTrait
.builder()
.memberLocationName("RecurringCharge")
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(RecurringCharge::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("RecurringCharge").build()).build()).build()).build();
private static final SdkField RESERVATION_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ReservationARN").getter(getter(ReservedCacheNode::reservationARN))
.setter(setter(Builder::reservationARN))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ReservationARN").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(RESERVED_CACHE_NODE_ID_FIELD,
RESERVED_CACHE_NODES_OFFERING_ID_FIELD, CACHE_NODE_TYPE_FIELD, START_TIME_FIELD, DURATION_FIELD, FIXED_PRICE_FIELD,
USAGE_PRICE_FIELD, CACHE_NODE_COUNT_FIELD, PRODUCT_DESCRIPTION_FIELD, OFFERING_TYPE_FIELD, STATE_FIELD,
RECURRING_CHARGES_FIELD, RESERVATION_ARN_FIELD));
private static final long serialVersionUID = 1L;
private final String reservedCacheNodeId;
private final String reservedCacheNodesOfferingId;
private final String cacheNodeType;
private final Instant startTime;
private final Integer duration;
private final Double fixedPrice;
private final Double usagePrice;
private final Integer cacheNodeCount;
private final String productDescription;
private final String offeringType;
private final String state;
private final List recurringCharges;
private final String reservationARN;
private ReservedCacheNode(BuilderImpl builder) {
this.reservedCacheNodeId = builder.reservedCacheNodeId;
this.reservedCacheNodesOfferingId = builder.reservedCacheNodesOfferingId;
this.cacheNodeType = builder.cacheNodeType;
this.startTime = builder.startTime;
this.duration = builder.duration;
this.fixedPrice = builder.fixedPrice;
this.usagePrice = builder.usagePrice;
this.cacheNodeCount = builder.cacheNodeCount;
this.productDescription = builder.productDescription;
this.offeringType = builder.offeringType;
this.state = builder.state;
this.recurringCharges = builder.recurringCharges;
this.reservationARN = builder.reservationARN;
}
/**
*
* The unique identifier for the reservation.
*
*
* @return The unique identifier for the reservation.
*/
public final String reservedCacheNodeId() {
return reservedCacheNodeId;
}
/**
*
* The offering identifier.
*
*
* @return The offering identifier.
*/
public final String reservedCacheNodesOfferingId() {
return reservedCacheNodesOfferingId;
}
/**
*
* The cache node type for the reserved cache nodes.
*
*
* The following node types are supported by ElastiCache. Generally speaking, the current generation types provide
* more memory and computational power at lower cost when compared to their equivalent previous generation
* counterparts.
*
*
* -
*
* General purpose:
*
*
* -
*
* Current generation:
*
*
* M7g node types: cache.m7g.large
, cache.m7g.xlarge
,
* cache.m7g.2xlarge
, cache.m7g.4xlarge
, cache.m7g.8xlarge
,
* cache.m7g.12xlarge
, cache.m7g.16xlarge
*
*
*
* For region availability, see Supported Node Types
*
*
*
* M6g node types (available only for Redis engine version 5.0.6 onward and for Memcached engine version
* 1.5.16 onward): cache.m6g.large
, cache.m6g.xlarge
, cache.m6g.2xlarge
,
* cache.m6g.4xlarge
, cache.m6g.8xlarge
, cache.m6g.12xlarge
,
* cache.m6g.16xlarge
*
*
* M5 node types: cache.m5.large
, cache.m5.xlarge
, cache.m5.2xlarge
,
* cache.m5.4xlarge
, cache.m5.12xlarge
, cache.m5.24xlarge
*
*
* M4 node types: cache.m4.large
, cache.m4.xlarge
, cache.m4.2xlarge
,
* cache.m4.4xlarge
, cache.m4.10xlarge
*
*
* T4g node types (available only for Redis engine version 5.0.6 onward and Memcached engine version 1.5.16
* onward): cache.t4g.micro
, cache.t4g.small
, cache.t4g.medium
*
*
* T3 node types: cache.t3.micro
, cache.t3.small
, cache.t3.medium
*
*
* T2 node types: cache.t2.micro
, cache.t2.small
, cache.t2.medium
*
*
* -
*
* Previous generation: (not recommended. Existing clusters are still supported but creation of new clusters is not
* supported for these types.)
*
*
* T1 node types: cache.t1.micro
*
*
* M1 node types: cache.m1.small
, cache.m1.medium
, cache.m1.large
,
* cache.m1.xlarge
*
*
* M3 node types: cache.m3.medium
, cache.m3.large
, cache.m3.xlarge
,
* cache.m3.2xlarge
*
*
*
*
* -
*
* Compute optimized:
*
*
* -
*
* Previous generation: (not recommended. Existing clusters are still supported but creation of new clusters is not
* supported for these types.)
*
*
* C1 node types: cache.c1.xlarge
*
*
*
*
* -
*
* Memory optimized:
*
*
* -
*
* Current generation:
*
*
* R7g node types: cache.r7g.large
, cache.r7g.xlarge
,
* cache.r7g.2xlarge
, cache.r7g.4xlarge
, cache.r7g.8xlarge
,
* cache.r7g.12xlarge
, cache.r7g.16xlarge
*
*
*
* For region availability, see Supported Node Types
*
*
*
* R6g node types (available only for Redis engine version 5.0.6 onward and for Memcached engine version
* 1.5.16 onward): cache.r6g.large
, cache.r6g.xlarge
, cache.r6g.2xlarge
,
* cache.r6g.4xlarge
, cache.r6g.8xlarge
, cache.r6g.12xlarge
,
* cache.r6g.16xlarge
*
*
* R5 node types: cache.r5.large
, cache.r5.xlarge
, cache.r5.2xlarge
,
* cache.r5.4xlarge
, cache.r5.12xlarge
, cache.r5.24xlarge
*
*
* R4 node types: cache.r4.large
, cache.r4.xlarge
, cache.r4.2xlarge
,
* cache.r4.4xlarge
, cache.r4.8xlarge
, cache.r4.16xlarge
*
*
* -
*
* Previous generation: (not recommended. Existing clusters are still supported but creation of new clusters is not
* supported for these types.)
*
*
* M2 node types: cache.m2.xlarge
, cache.m2.2xlarge
, cache.m2.4xlarge
*
*
* R3 node types: cache.r3.large
, cache.r3.xlarge
, cache.r3.2xlarge
,
* cache.r3.4xlarge
, cache.r3.8xlarge
*
*
*
*
*
*
* Additional node type info
*
*
* -
*
* All current generation instance types are created in Amazon VPC by default.
*
*
* -
*
* Redis append-only files (AOF) are not supported for T1 or T2 instances.
*
*
* -
*
* Redis Multi-AZ with automatic failover is not supported on T1 instances.
*
*
* -
*
* Redis configuration variables appendonly
and appendfsync
are not supported on Redis
* version 2.8.22 and later.
*
*
*
*
* @return The cache node type for the reserved cache nodes.
*
* The following node types are supported by ElastiCache. Generally speaking, the current generation types
* provide more memory and computational power at lower cost when compared to their equivalent previous
* generation counterparts.
*
*
* -
*
* General purpose:
*
*
* -
*
* Current generation:
*
*
* M7g node types: cache.m7g.large
, cache.m7g.xlarge
,
* cache.m7g.2xlarge
, cache.m7g.4xlarge
, cache.m7g.8xlarge
,
* cache.m7g.12xlarge
, cache.m7g.16xlarge
*
*
*
* For region availability, see Supported Node Types
*
*
*
* M6g node types (available only for Redis engine version 5.0.6 onward and for Memcached engine
* version 1.5.16 onward): cache.m6g.large
, cache.m6g.xlarge
,
* cache.m6g.2xlarge
, cache.m6g.4xlarge
, cache.m6g.8xlarge
,
* cache.m6g.12xlarge
, cache.m6g.16xlarge
*
*
* M5 node types: cache.m5.large
, cache.m5.xlarge
,
* cache.m5.2xlarge
, cache.m5.4xlarge
, cache.m5.12xlarge
,
* cache.m5.24xlarge
*
*
* M4 node types: cache.m4.large
, cache.m4.xlarge
,
* cache.m4.2xlarge
, cache.m4.4xlarge
, cache.m4.10xlarge
*
*
* T4g node types (available only for Redis engine version 5.0.6 onward and Memcached engine version
* 1.5.16 onward): cache.t4g.micro
, cache.t4g.small
, cache.t4g.medium
*
*
* T3 node types: cache.t3.micro
, cache.t3.small
,
* cache.t3.medium
*
*
* T2 node types: cache.t2.micro
, cache.t2.small
,
* cache.t2.medium
*
*
* -
*
* Previous generation: (not recommended. Existing clusters are still supported but creation of new clusters
* is not supported for these types.)
*
*
* T1 node types: cache.t1.micro
*
*
* M1 node types: cache.m1.small
, cache.m1.medium
,
* cache.m1.large
, cache.m1.xlarge
*
*
* M3 node types: cache.m3.medium
, cache.m3.large
,
* cache.m3.xlarge
, cache.m3.2xlarge
*
*
*
*
* -
*
* Compute optimized:
*
*
* -
*
* Previous generation: (not recommended. Existing clusters are still supported but creation of new clusters
* is not supported for these types.)
*
*
* C1 node types: cache.c1.xlarge
*
*
*
*
* -
*
* Memory optimized:
*
*
* -
*
* Current generation:
*
*
* R7g node types: cache.r7g.large
, cache.r7g.xlarge
,
* cache.r7g.2xlarge
, cache.r7g.4xlarge
, cache.r7g.8xlarge
,
* cache.r7g.12xlarge
, cache.r7g.16xlarge
*
*
*
* For region availability, see Supported Node Types
*
*
*
* R6g node types (available only for Redis engine version 5.0.6 onward and for Memcached engine
* version 1.5.16 onward): cache.r6g.large
, cache.r6g.xlarge
,
* cache.r6g.2xlarge
, cache.r6g.4xlarge
, cache.r6g.8xlarge
,
* cache.r6g.12xlarge
, cache.r6g.16xlarge
*
*
* R5 node types: cache.r5.large
, cache.r5.xlarge
,
* cache.r5.2xlarge
, cache.r5.4xlarge
, cache.r5.12xlarge
,
* cache.r5.24xlarge
*
*
* R4 node types: cache.r4.large
, cache.r4.xlarge
,
* cache.r4.2xlarge
, cache.r4.4xlarge
, cache.r4.8xlarge
,
* cache.r4.16xlarge
*
*
* -
*
* Previous generation: (not recommended. Existing clusters are still supported but creation of new clusters
* is not supported for these types.)
*
*
* M2 node types: cache.m2.xlarge
, cache.m2.2xlarge
,
* cache.m2.4xlarge
*
*
* R3 node types: cache.r3.large
, cache.r3.xlarge
,
* cache.r3.2xlarge
, cache.r3.4xlarge
, cache.r3.8xlarge
*
*
*
*
*
*
* Additional node type info
*
*
* -
*
* All current generation instance types are created in Amazon VPC by default.
*
*
* -
*
* Redis append-only files (AOF) are not supported for T1 or T2 instances.
*
*
* -
*
* Redis Multi-AZ with automatic failover is not supported on T1 instances.
*
*
* -
*
* Redis configuration variables appendonly
and appendfsync
are not supported on
* Redis version 2.8.22 and later.
*
*
*/
public final String cacheNodeType() {
return cacheNodeType;
}
/**
*
* The time the reservation started.
*
*
* @return The time the reservation started.
*/
public final Instant startTime() {
return startTime;
}
/**
*
* The duration of the reservation in seconds.
*
*
* @return The duration of the reservation in seconds.
*/
public final Integer duration() {
return duration;
}
/**
*
* The fixed price charged for this reserved cache node.
*
*
* @return The fixed price charged for this reserved cache node.
*/
public final Double fixedPrice() {
return fixedPrice;
}
/**
*
* The hourly price charged for this reserved cache node.
*
*
* @return The hourly price charged for this reserved cache node.
*/
public final Double usagePrice() {
return usagePrice;
}
/**
*
* The number of cache nodes that have been reserved.
*
*
* @return The number of cache nodes that have been reserved.
*/
public final Integer cacheNodeCount() {
return cacheNodeCount;
}
/**
*
* The description of the reserved cache node.
*
*
* @return The description of the reserved cache node.
*/
public final String productDescription() {
return productDescription;
}
/**
*
* The offering type of this reserved cache node.
*
*
* @return The offering type of this reserved cache node.
*/
public final String offeringType() {
return offeringType;
}
/**
*
* The state of the reserved cache node.
*
*
* @return The state of the reserved cache node.
*/
public final String state() {
return state;
}
/**
* For responses, this returns true if the service returned a value for the RecurringCharges property. This DOES NOT
* check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasRecurringCharges() {
return recurringCharges != null && !(recurringCharges instanceof SdkAutoConstructList);
}
/**
*
* The recurring price charged to run this reserved cache node.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasRecurringCharges} method.
*
*
* @return The recurring price charged to run this reserved cache node.
*/
public final List recurringCharges() {
return recurringCharges;
}
/**
*
* The Amazon Resource Name (ARN) of the reserved cache node.
*
*
* Example: arn:aws:elasticache:us-east-1:123456789012:reserved-instance:ri-2017-03-27-08-33-25-582
*
*
* @return The Amazon Resource Name (ARN) of the reserved cache node.
*
* Example:
* arn:aws:elasticache:us-east-1:123456789012:reserved-instance:ri-2017-03-27-08-33-25-582
*/
public final String reservationARN() {
return reservationARN;
}
@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(reservedCacheNodeId());
hashCode = 31 * hashCode + Objects.hashCode(reservedCacheNodesOfferingId());
hashCode = 31 * hashCode + Objects.hashCode(cacheNodeType());
hashCode = 31 * hashCode + Objects.hashCode(startTime());
hashCode = 31 * hashCode + Objects.hashCode(duration());
hashCode = 31 * hashCode + Objects.hashCode(fixedPrice());
hashCode = 31 * hashCode + Objects.hashCode(usagePrice());
hashCode = 31 * hashCode + Objects.hashCode(cacheNodeCount());
hashCode = 31 * hashCode + Objects.hashCode(productDescription());
hashCode = 31 * hashCode + Objects.hashCode(offeringType());
hashCode = 31 * hashCode + Objects.hashCode(state());
hashCode = 31 * hashCode + Objects.hashCode(hasRecurringCharges() ? recurringCharges() : null);
hashCode = 31 * hashCode + Objects.hashCode(reservationARN());
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 ReservedCacheNode)) {
return false;
}
ReservedCacheNode other = (ReservedCacheNode) obj;
return Objects.equals(reservedCacheNodeId(), other.reservedCacheNodeId())
&& Objects.equals(reservedCacheNodesOfferingId(), other.reservedCacheNodesOfferingId())
&& Objects.equals(cacheNodeType(), other.cacheNodeType()) && Objects.equals(startTime(), other.startTime())
&& Objects.equals(duration(), other.duration()) && Objects.equals(fixedPrice(), other.fixedPrice())
&& Objects.equals(usagePrice(), other.usagePrice()) && Objects.equals(cacheNodeCount(), other.cacheNodeCount())
&& Objects.equals(productDescription(), other.productDescription())
&& Objects.equals(offeringType(), other.offeringType()) && Objects.equals(state(), other.state())
&& hasRecurringCharges() == other.hasRecurringCharges()
&& Objects.equals(recurringCharges(), other.recurringCharges())
&& Objects.equals(reservationARN(), other.reservationARN());
}
/**
* 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("ReservedCacheNode").add("ReservedCacheNodeId", reservedCacheNodeId())
.add("ReservedCacheNodesOfferingId", reservedCacheNodesOfferingId()).add("CacheNodeType", cacheNodeType())
.add("StartTime", startTime()).add("Duration", duration()).add("FixedPrice", fixedPrice())
.add("UsagePrice", usagePrice()).add("CacheNodeCount", cacheNodeCount())
.add("ProductDescription", productDescription()).add("OfferingType", offeringType()).add("State", state())
.add("RecurringCharges", hasRecurringCharges() ? recurringCharges() : null)
.add("ReservationARN", reservationARN()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "ReservedCacheNodeId":
return Optional.ofNullable(clazz.cast(reservedCacheNodeId()));
case "ReservedCacheNodesOfferingId":
return Optional.ofNullable(clazz.cast(reservedCacheNodesOfferingId()));
case "CacheNodeType":
return Optional.ofNullable(clazz.cast(cacheNodeType()));
case "StartTime":
return Optional.ofNullable(clazz.cast(startTime()));
case "Duration":
return Optional.ofNullable(clazz.cast(duration()));
case "FixedPrice":
return Optional.ofNullable(clazz.cast(fixedPrice()));
case "UsagePrice":
return Optional.ofNullable(clazz.cast(usagePrice()));
case "CacheNodeCount":
return Optional.ofNullable(clazz.cast(cacheNodeCount()));
case "ProductDescription":
return Optional.ofNullable(clazz.cast(productDescription()));
case "OfferingType":
return Optional.ofNullable(clazz.cast(offeringType()));
case "State":
return Optional.ofNullable(clazz.cast(state()));
case "RecurringCharges":
return Optional.ofNullable(clazz.cast(recurringCharges()));
case "ReservationARN":
return Optional.ofNullable(clazz.cast(reservationARN()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function
*
* The following node types are supported by ElastiCache. Generally speaking, the current generation
* types provide more memory and computational power at lower cost when compared to their equivalent
* previous generation counterparts.
*
*
* -
*
* General purpose:
*
*
* -
*
* Current generation:
*
*
* M7g node types: cache.m7g.large
, cache.m7g.xlarge
,
* cache.m7g.2xlarge
, cache.m7g.4xlarge
, cache.m7g.8xlarge
,
* cache.m7g.12xlarge
, cache.m7g.16xlarge
*
*
*
* For region availability, see Supported Node Types
*
*
*
* M6g node types (available only for Redis engine version 5.0.6 onward and for Memcached engine
* version 1.5.16 onward): cache.m6g.large
, cache.m6g.xlarge
,
* cache.m6g.2xlarge
, cache.m6g.4xlarge
, cache.m6g.8xlarge
,
* cache.m6g.12xlarge
, cache.m6g.16xlarge
*
*
* M5 node types: cache.m5.large
, cache.m5.xlarge
,
* cache.m5.2xlarge
, cache.m5.4xlarge
, cache.m5.12xlarge
,
* cache.m5.24xlarge
*
*
* M4 node types: cache.m4.large
, cache.m4.xlarge
,
* cache.m4.2xlarge
, cache.m4.4xlarge
, cache.m4.10xlarge
*
*
* T4g node types (available only for Redis engine version 5.0.6 onward and Memcached engine
* version 1.5.16 onward): cache.t4g.micro
, cache.t4g.small
,
* cache.t4g.medium
*
*
* T3 node types: cache.t3.micro
, cache.t3.small
,
* cache.t3.medium
*
*
* T2 node types: cache.t2.micro
, cache.t2.small
,
* cache.t2.medium
*
*
* -
*
* Previous generation: (not recommended. Existing clusters are still supported but creation of new
* clusters is not supported for these types.)
*
*
* T1 node types: cache.t1.micro
*
*
* M1 node types: cache.m1.small
, cache.m1.medium
,
* cache.m1.large
, cache.m1.xlarge
*
*
* M3 node types: cache.m3.medium
, cache.m3.large
,
* cache.m3.xlarge
, cache.m3.2xlarge
*
*
*
*
* -
*
* Compute optimized:
*
*
* -
*
* Previous generation: (not recommended. Existing clusters are still supported but creation of new
* clusters is not supported for these types.)
*
*
* C1 node types: cache.c1.xlarge
*
*
*
*
* -
*
* Memory optimized:
*
*
* -
*
* Current generation:
*
*
* R7g node types: cache.r7g.large
, cache.r7g.xlarge
,
* cache.r7g.2xlarge
, cache.r7g.4xlarge
, cache.r7g.8xlarge
,
* cache.r7g.12xlarge
, cache.r7g.16xlarge
*
*
*
* For region availability, see Supported Node Types
*
*
*
* R6g node types (available only for Redis engine version 5.0.6 onward and for Memcached engine
* version 1.5.16 onward): cache.r6g.large
, cache.r6g.xlarge
,
* cache.r6g.2xlarge
, cache.r6g.4xlarge
, cache.r6g.8xlarge
,
* cache.r6g.12xlarge
, cache.r6g.16xlarge
*
*
* R5 node types: cache.r5.large
, cache.r5.xlarge
,
* cache.r5.2xlarge
, cache.r5.4xlarge
, cache.r5.12xlarge
,
* cache.r5.24xlarge
*
*
* R4 node types: cache.r4.large
, cache.r4.xlarge
,
* cache.r4.2xlarge
, cache.r4.4xlarge
, cache.r4.8xlarge
,
* cache.r4.16xlarge
*
*
* -
*
* Previous generation: (not recommended. Existing clusters are still supported but creation of new
* clusters is not supported for these types.)
*
*
* M2 node types: cache.m2.xlarge
, cache.m2.2xlarge
,
* cache.m2.4xlarge
*
*
* R3 node types: cache.r3.large
, cache.r3.xlarge
,
* cache.r3.2xlarge
, cache.r3.4xlarge
, cache.r3.8xlarge
*
*
*
*
*
*
* Additional node type info
*
*
* -
*
* All current generation instance types are created in Amazon VPC by default.
*
*
* -
*
* Redis append-only files (AOF) are not supported for T1 or T2 instances.
*
*
* -
*
* Redis Multi-AZ with automatic failover is not supported on T1 instances.
*
*
* -
*
* Redis configuration variables appendonly
and appendfsync
are not supported
* on Redis version 2.8.22 and later.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder cacheNodeType(String cacheNodeType);
/**
*
* The time the reservation started.
*
*
* @param startTime
* The time the reservation started.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder startTime(Instant startTime);
/**
*
* The duration of the reservation in seconds.
*
*
* @param duration
* The duration of the reservation in seconds.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder duration(Integer duration);
/**
*
* The fixed price charged for this reserved cache node.
*
*
* @param fixedPrice
* The fixed price charged for this reserved cache node.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder fixedPrice(Double fixedPrice);
/**
*
* The hourly price charged for this reserved cache node.
*
*
* @param usagePrice
* The hourly price charged for this reserved cache node.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder usagePrice(Double usagePrice);
/**
*
* The number of cache nodes that have been reserved.
*
*
* @param cacheNodeCount
* The number of cache nodes that have been reserved.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder cacheNodeCount(Integer cacheNodeCount);
/**
*
* The description of the reserved cache node.
*
*
* @param productDescription
* The description of the reserved cache node.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder productDescription(String productDescription);
/**
*
* The offering type of this reserved cache node.
*
*
* @param offeringType
* The offering type of this reserved cache node.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder offeringType(String offeringType);
/**
*
* The state of the reserved cache node.
*
*
* @param state
* The state of the reserved cache node.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder state(String state);
/**
*
* The recurring price charged to run this reserved cache node.
*
*
* @param recurringCharges
* The recurring price charged to run this reserved cache node.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder recurringCharges(Collection recurringCharges);
/**
*
* The recurring price charged to run this reserved cache node.
*
*
* @param recurringCharges
* The recurring price charged to run this reserved cache node.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder recurringCharges(RecurringCharge... recurringCharges);
/**
*
* The recurring price charged to run this reserved cache node.
*
* This is a convenience method that creates an instance of the
* {@link software.amazon.awssdk.services.elasticache.model.RecurringCharge.Builder} avoiding the need to create
* one manually via {@link software.amazon.awssdk.services.elasticache.model.RecurringCharge#builder()}.
*
*
* When the {@link Consumer} completes,
* {@link software.amazon.awssdk.services.elasticache.model.RecurringCharge.Builder#build()} is called
* immediately and its result is passed to {@link #recurringCharges(List)}.
*
* @param recurringCharges
* a consumer that will call methods on
* {@link software.amazon.awssdk.services.elasticache.model.RecurringCharge.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #recurringCharges(java.util.Collection)
*/
Builder recurringCharges(Consumer... recurringCharges);
/**
*
* The Amazon Resource Name (ARN) of the reserved cache node.
*
*
* Example: arn:aws:elasticache:us-east-1:123456789012:reserved-instance:ri-2017-03-27-08-33-25-582
*
*
* @param reservationARN
* The Amazon Resource Name (ARN) of the reserved cache node.
*
* Example:
* arn:aws:elasticache:us-east-1:123456789012:reserved-instance:ri-2017-03-27-08-33-25-582
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder reservationARN(String reservationARN);
}
static final class BuilderImpl implements Builder {
private String reservedCacheNodeId;
private String reservedCacheNodesOfferingId;
private String cacheNodeType;
private Instant startTime;
private Integer duration;
private Double fixedPrice;
private Double usagePrice;
private Integer cacheNodeCount;
private String productDescription;
private String offeringType;
private String state;
private List recurringCharges = DefaultSdkAutoConstructList.getInstance();
private String reservationARN;
private BuilderImpl() {
}
private BuilderImpl(ReservedCacheNode model) {
reservedCacheNodeId(model.reservedCacheNodeId);
reservedCacheNodesOfferingId(model.reservedCacheNodesOfferingId);
cacheNodeType(model.cacheNodeType);
startTime(model.startTime);
duration(model.duration);
fixedPrice(model.fixedPrice);
usagePrice(model.usagePrice);
cacheNodeCount(model.cacheNodeCount);
productDescription(model.productDescription);
offeringType(model.offeringType);
state(model.state);
recurringCharges(model.recurringCharges);
reservationARN(model.reservationARN);
}
public final String getReservedCacheNodeId() {
return reservedCacheNodeId;
}
public final void setReservedCacheNodeId(String reservedCacheNodeId) {
this.reservedCacheNodeId = reservedCacheNodeId;
}
@Override
public final Builder reservedCacheNodeId(String reservedCacheNodeId) {
this.reservedCacheNodeId = reservedCacheNodeId;
return this;
}
public final String getReservedCacheNodesOfferingId() {
return reservedCacheNodesOfferingId;
}
public final void setReservedCacheNodesOfferingId(String reservedCacheNodesOfferingId) {
this.reservedCacheNodesOfferingId = reservedCacheNodesOfferingId;
}
@Override
public final Builder reservedCacheNodesOfferingId(String reservedCacheNodesOfferingId) {
this.reservedCacheNodesOfferingId = reservedCacheNodesOfferingId;
return this;
}
public final String getCacheNodeType() {
return cacheNodeType;
}
public final void setCacheNodeType(String cacheNodeType) {
this.cacheNodeType = cacheNodeType;
}
@Override
public final Builder cacheNodeType(String cacheNodeType) {
this.cacheNodeType = cacheNodeType;
return this;
}
public final Instant getStartTime() {
return startTime;
}
public final void setStartTime(Instant startTime) {
this.startTime = startTime;
}
@Override
public final Builder startTime(Instant startTime) {
this.startTime = startTime;
return this;
}
public final Integer getDuration() {
return duration;
}
public final void setDuration(Integer duration) {
this.duration = duration;
}
@Override
public final Builder duration(Integer duration) {
this.duration = duration;
return this;
}
public final Double getFixedPrice() {
return fixedPrice;
}
public final void setFixedPrice(Double fixedPrice) {
this.fixedPrice = fixedPrice;
}
@Override
public final Builder fixedPrice(Double fixedPrice) {
this.fixedPrice = fixedPrice;
return this;
}
public final Double getUsagePrice() {
return usagePrice;
}
public final void setUsagePrice(Double usagePrice) {
this.usagePrice = usagePrice;
}
@Override
public final Builder usagePrice(Double usagePrice) {
this.usagePrice = usagePrice;
return this;
}
public final Integer getCacheNodeCount() {
return cacheNodeCount;
}
public final void setCacheNodeCount(Integer cacheNodeCount) {
this.cacheNodeCount = cacheNodeCount;
}
@Override
public final Builder cacheNodeCount(Integer cacheNodeCount) {
this.cacheNodeCount = cacheNodeCount;
return this;
}
public final String getProductDescription() {
return productDescription;
}
public final void setProductDescription(String productDescription) {
this.productDescription = productDescription;
}
@Override
public final Builder productDescription(String productDescription) {
this.productDescription = productDescription;
return this;
}
public final String getOfferingType() {
return offeringType;
}
public final void setOfferingType(String offeringType) {
this.offeringType = offeringType;
}
@Override
public final Builder offeringType(String offeringType) {
this.offeringType = offeringType;
return this;
}
public final String getState() {
return state;
}
public final void setState(String state) {
this.state = state;
}
@Override
public final Builder state(String state) {
this.state = state;
return this;
}
public final List getRecurringCharges() {
List result = RecurringChargeListCopier.copyToBuilder(this.recurringCharges);
if (result instanceof SdkAutoConstructList) {
return null;
}
return result;
}
public final void setRecurringCharges(Collection recurringCharges) {
this.recurringCharges = RecurringChargeListCopier.copyFromBuilder(recurringCharges);
}
@Override
public final Builder recurringCharges(Collection recurringCharges) {
this.recurringCharges = RecurringChargeListCopier.copy(recurringCharges);
return this;
}
@Override
@SafeVarargs
public final Builder recurringCharges(RecurringCharge... recurringCharges) {
recurringCharges(Arrays.asList(recurringCharges));
return this;
}
@Override
@SafeVarargs
public final Builder recurringCharges(Consumer... recurringCharges) {
recurringCharges(Stream.of(recurringCharges).map(c -> RecurringCharge.builder().applyMutation(c).build())
.collect(Collectors.toList()));
return this;
}
public final String getReservationARN() {
return reservationARN;
}
public final void setReservationARN(String reservationARN) {
this.reservationARN = reservationARN;
}
@Override
public final Builder reservationARN(String reservationARN) {
this.reservationARN = reservationARN;
return this;
}
@Override
public ReservedCacheNode build() {
return new ReservedCacheNode(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
}
}