software.amazon.awssdk.services.elasticache.model.CacheEngineVersion 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.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;
/**
*
* Provides all of the details about a particular cache engine version.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class CacheEngineVersion implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField ENGINE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Engine")
.getter(getter(CacheEngineVersion::engine)).setter(setter(Builder::engine))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Engine").build()).build();
private static final SdkField ENGINE_VERSION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("EngineVersion").getter(getter(CacheEngineVersion::engineVersion)).setter(setter(Builder::engineVersion))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EngineVersion").build()).build();
private static final SdkField CACHE_PARAMETER_GROUP_FAMILY_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("CacheParameterGroupFamily").getter(getter(CacheEngineVersion::cacheParameterGroupFamily))
.setter(setter(Builder::cacheParameterGroupFamily))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CacheParameterGroupFamily").build())
.build();
private static final SdkField CACHE_ENGINE_DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("CacheEngineDescription").getter(getter(CacheEngineVersion::cacheEngineDescription))
.setter(setter(Builder::cacheEngineDescription))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CacheEngineDescription").build())
.build();
private static final SdkField CACHE_ENGINE_VERSION_DESCRIPTION_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("CacheEngineVersionDescription")
.getter(getter(CacheEngineVersion::cacheEngineVersionDescription))
.setter(setter(Builder::cacheEngineVersionDescription))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CacheEngineVersionDescription")
.build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ENGINE_FIELD,
ENGINE_VERSION_FIELD, CACHE_PARAMETER_GROUP_FAMILY_FIELD, CACHE_ENGINE_DESCRIPTION_FIELD,
CACHE_ENGINE_VERSION_DESCRIPTION_FIELD));
private static final long serialVersionUID = 1L;
private final String engine;
private final String engineVersion;
private final String cacheParameterGroupFamily;
private final String cacheEngineDescription;
private final String cacheEngineVersionDescription;
private CacheEngineVersion(BuilderImpl builder) {
this.engine = builder.engine;
this.engineVersion = builder.engineVersion;
this.cacheParameterGroupFamily = builder.cacheParameterGroupFamily;
this.cacheEngineDescription = builder.cacheEngineDescription;
this.cacheEngineVersionDescription = builder.cacheEngineVersionDescription;
}
/**
*
* The name of the cache engine.
*
*
* @return The name of the cache engine.
*/
public final String engine() {
return engine;
}
/**
*
* The version number of the cache engine.
*
*
* @return The version number of the cache engine.
*/
public final String engineVersion() {
return engineVersion;
}
/**
*
* The name of the cache parameter group family associated with this cache engine.
*
*
* Valid values are: memcached1.4
| memcached1.5
| memcached1.6
|
* redis2.6
| redis2.8
| redis3.2
| redis4.0
|
* redis5.0
| redis6.x
| redis7
*
*
* @return The name of the cache parameter group family associated with this cache engine.
*
* Valid values are: memcached1.4
| memcached1.5
| memcached1.6
|
* redis2.6
| redis2.8
| redis3.2
| redis4.0
|
* redis5.0
| redis6.x
| redis7
*/
public final String cacheParameterGroupFamily() {
return cacheParameterGroupFamily;
}
/**
*
* The description of the cache engine.
*
*
* @return The description of the cache engine.
*/
public final String cacheEngineDescription() {
return cacheEngineDescription;
}
/**
*
* The description of the cache engine version.
*
*
* @return The description of the cache engine version.
*/
public final String cacheEngineVersionDescription() {
return cacheEngineVersionDescription;
}
@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(engine());
hashCode = 31 * hashCode + Objects.hashCode(engineVersion());
hashCode = 31 * hashCode + Objects.hashCode(cacheParameterGroupFamily());
hashCode = 31 * hashCode + Objects.hashCode(cacheEngineDescription());
hashCode = 31 * hashCode + Objects.hashCode(cacheEngineVersionDescription());
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 CacheEngineVersion)) {
return false;
}
CacheEngineVersion other = (CacheEngineVersion) obj;
return Objects.equals(engine(), other.engine()) && Objects.equals(engineVersion(), other.engineVersion())
&& Objects.equals(cacheParameterGroupFamily(), other.cacheParameterGroupFamily())
&& Objects.equals(cacheEngineDescription(), other.cacheEngineDescription())
&& Objects.equals(cacheEngineVersionDescription(), other.cacheEngineVersionDescription());
}
/**
* 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("CacheEngineVersion").add("Engine", engine()).add("EngineVersion", engineVersion())
.add("CacheParameterGroupFamily", cacheParameterGroupFamily())
.add("CacheEngineDescription", cacheEngineDescription())
.add("CacheEngineVersionDescription", cacheEngineVersionDescription()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "Engine":
return Optional.ofNullable(clazz.cast(engine()));
case "EngineVersion":
return Optional.ofNullable(clazz.cast(engineVersion()));
case "CacheParameterGroupFamily":
return Optional.ofNullable(clazz.cast(cacheParameterGroupFamily()));
case "CacheEngineDescription":
return Optional.ofNullable(clazz.cast(cacheEngineDescription()));
case "CacheEngineVersionDescription":
return Optional.ofNullable(clazz.cast(cacheEngineVersionDescription()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function