All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.dax.model.Parameter Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amazon DynamoDB Accelerator (DAX) module holds the client classes that are used for communicating with Amazon DynamoDB Accelerator (DAX).

There is a newer version: 2.30.1
Show newest version
/*
 * 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.dax.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.core.util.SdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* Describes an individual setting that controls some aspect of DAX behavior. *

*/ @Generated("software.amazon.awssdk:codegen") public final class Parameter implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField PARAMETER_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ParameterName").getter(getter(Parameter::parameterName)).setter(setter(Builder::parameterName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ParameterName").build()).build(); private static final SdkField PARAMETER_TYPE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ParameterType").getter(getter(Parameter::parameterTypeAsString)).setter(setter(Builder::parameterType)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ParameterType").build()).build(); private static final SdkField PARAMETER_VALUE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ParameterValue").getter(getter(Parameter::parameterValue)).setter(setter(Builder::parameterValue)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ParameterValue").build()).build(); private static final SdkField> NODE_TYPE_SPECIFIC_VALUES_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("NodeTypeSpecificValues") .getter(getter(Parameter::nodeTypeSpecificValues)) .setter(setter(Builder::nodeTypeSpecificValues)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NodeTypeSpecificValues").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(NodeTypeSpecificValue::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("Description").getter(getter(Parameter::description)).setter(setter(Builder::description)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Description").build()).build(); private static final SdkField SOURCE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Source") .getter(getter(Parameter::source)).setter(setter(Builder::source)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Source").build()).build(); private static final SdkField DATA_TYPE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("DataType").getter(getter(Parameter::dataType)).setter(setter(Builder::dataType)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DataType").build()).build(); private static final SdkField ALLOWED_VALUES_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("AllowedValues").getter(getter(Parameter::allowedValues)).setter(setter(Builder::allowedValues)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AllowedValues").build()).build(); private static final SdkField IS_MODIFIABLE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("IsModifiable").getter(getter(Parameter::isModifiableAsString)).setter(setter(Builder::isModifiable)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IsModifiable").build()).build(); private static final SdkField CHANGE_TYPE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ChangeType").getter(getter(Parameter::changeTypeAsString)).setter(setter(Builder::changeType)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ChangeType").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(PARAMETER_NAME_FIELD, PARAMETER_TYPE_FIELD, PARAMETER_VALUE_FIELD, NODE_TYPE_SPECIFIC_VALUES_FIELD, DESCRIPTION_FIELD, SOURCE_FIELD, DATA_TYPE_FIELD, ALLOWED_VALUES_FIELD, IS_MODIFIABLE_FIELD, CHANGE_TYPE_FIELD)); private static final long serialVersionUID = 1L; private final String parameterName; private final String parameterType; private final String parameterValue; private final List nodeTypeSpecificValues; private final String description; private final String source; private final String dataType; private final String allowedValues; private final String isModifiable; private final String changeType; private Parameter(BuilderImpl builder) { this.parameterName = builder.parameterName; this.parameterType = builder.parameterType; this.parameterValue = builder.parameterValue; this.nodeTypeSpecificValues = builder.nodeTypeSpecificValues; this.description = builder.description; this.source = builder.source; this.dataType = builder.dataType; this.allowedValues = builder.allowedValues; this.isModifiable = builder.isModifiable; this.changeType = builder.changeType; } /** *

* The name of the parameter. *

* * @return The name of the parameter. */ public final String parameterName() { return parameterName; } /** *

* Determines whether the parameter can be applied to any nodes, or only nodes of a particular type. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #parameterType} * will return {@link ParameterType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #parameterTypeAsString}. *

* * @return Determines whether the parameter can be applied to any nodes, or only nodes of a particular type. * @see ParameterType */ public final ParameterType parameterType() { return ParameterType.fromValue(parameterType); } /** *

* Determines whether the parameter can be applied to any nodes, or only nodes of a particular type. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #parameterType} * will return {@link ParameterType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #parameterTypeAsString}. *

* * @return Determines whether the parameter can be applied to any nodes, or only nodes of a particular type. * @see ParameterType */ public final String parameterTypeAsString() { return parameterType; } /** *

* The value for the parameter. *

* * @return The value for the parameter. */ public final String parameterValue() { return parameterValue; } /** * For responses, this returns true if the service returned a value for the NodeTypeSpecificValues 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 hasNodeTypeSpecificValues() { return nodeTypeSpecificValues != null && !(nodeTypeSpecificValues instanceof SdkAutoConstructList); } /** *

* A list of node types, and specific parameter values for each 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 #hasNodeTypeSpecificValues} method. *

* * @return A list of node types, and specific parameter values for each node. */ public final List nodeTypeSpecificValues() { return nodeTypeSpecificValues; } /** *

* A description of the parameter *

* * @return A description of the parameter */ public final String description() { return description; } /** *

* How the parameter is defined. For example, system denotes a system-defined parameter. *

* * @return How the parameter is defined. For example, system denotes a system-defined parameter. */ public final String source() { return source; } /** *

* The data type of the parameter. For example, integer: *

* * @return The data type of the parameter. For example, integer: */ public final String dataType() { return dataType; } /** *

* A range of values within which the parameter can be set. *

* * @return A range of values within which the parameter can be set. */ public final String allowedValues() { return allowedValues; } /** *

* Whether the customer is allowed to modify the parameter. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #isModifiable} will * return {@link IsModifiable#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #isModifiableAsString}. *

* * @return Whether the customer is allowed to modify the parameter. * @see IsModifiable */ public final IsModifiable isModifiable() { return IsModifiable.fromValue(isModifiable); } /** *

* Whether the customer is allowed to modify the parameter. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #isModifiable} will * return {@link IsModifiable#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #isModifiableAsString}. *

* * @return Whether the customer is allowed to modify the parameter. * @see IsModifiable */ public final String isModifiableAsString() { return isModifiable; } /** *

* The conditions under which changes to this parameter can be applied. For example, requires-reboot * indicates that a new value for this parameter will only take effect if a node is rebooted. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #changeType} will * return {@link ChangeType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #changeTypeAsString}. *

* * @return The conditions under which changes to this parameter can be applied. For example, * requires-reboot indicates that a new value for this parameter will only take effect if a * node is rebooted. * @see ChangeType */ public final ChangeType changeType() { return ChangeType.fromValue(changeType); } /** *

* The conditions under which changes to this parameter can be applied. For example, requires-reboot * indicates that a new value for this parameter will only take effect if a node is rebooted. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #changeType} will * return {@link ChangeType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #changeTypeAsString}. *

* * @return The conditions under which changes to this parameter can be applied. For example, * requires-reboot indicates that a new value for this parameter will only take effect if a * node is rebooted. * @see ChangeType */ public final String changeTypeAsString() { return changeType; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(parameterName()); hashCode = 31 * hashCode + Objects.hashCode(parameterTypeAsString()); hashCode = 31 * hashCode + Objects.hashCode(parameterValue()); hashCode = 31 * hashCode + Objects.hashCode(hasNodeTypeSpecificValues() ? nodeTypeSpecificValues() : null); hashCode = 31 * hashCode + Objects.hashCode(description()); hashCode = 31 * hashCode + Objects.hashCode(source()); hashCode = 31 * hashCode + Objects.hashCode(dataType()); hashCode = 31 * hashCode + Objects.hashCode(allowedValues()); hashCode = 31 * hashCode + Objects.hashCode(isModifiableAsString()); hashCode = 31 * hashCode + Objects.hashCode(changeTypeAsString()); 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 Parameter)) { return false; } Parameter other = (Parameter) obj; return Objects.equals(parameterName(), other.parameterName()) && Objects.equals(parameterTypeAsString(), other.parameterTypeAsString()) && Objects.equals(parameterValue(), other.parameterValue()) && hasNodeTypeSpecificValues() == other.hasNodeTypeSpecificValues() && Objects.equals(nodeTypeSpecificValues(), other.nodeTypeSpecificValues()) && Objects.equals(description(), other.description()) && Objects.equals(source(), other.source()) && Objects.equals(dataType(), other.dataType()) && Objects.equals(allowedValues(), other.allowedValues()) && Objects.equals(isModifiableAsString(), other.isModifiableAsString()) && Objects.equals(changeTypeAsString(), other.changeTypeAsString()); } /** * 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("Parameter").add("ParameterName", parameterName()).add("ParameterType", parameterTypeAsString()) .add("ParameterValue", parameterValue()) .add("NodeTypeSpecificValues", hasNodeTypeSpecificValues() ? nodeTypeSpecificValues() : null) .add("Description", description()).add("Source", source()).add("DataType", dataType()) .add("AllowedValues", allowedValues()).add("IsModifiable", isModifiableAsString()) .add("ChangeType", changeTypeAsString()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "ParameterName": return Optional.ofNullable(clazz.cast(parameterName())); case "ParameterType": return Optional.ofNullable(clazz.cast(parameterTypeAsString())); case "ParameterValue": return Optional.ofNullable(clazz.cast(parameterValue())); case "NodeTypeSpecificValues": return Optional.ofNullable(clazz.cast(nodeTypeSpecificValues())); case "Description": return Optional.ofNullable(clazz.cast(description())); case "Source": return Optional.ofNullable(clazz.cast(source())); case "DataType": return Optional.ofNullable(clazz.cast(dataType())); case "AllowedValues": return Optional.ofNullable(clazz.cast(allowedValues())); case "IsModifiable": return Optional.ofNullable(clazz.cast(isModifiableAsString())); case "ChangeType": return Optional.ofNullable(clazz.cast(changeTypeAsString())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((Parameter) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The name of the parameter. *

* * @param parameterName * The name of the parameter. * @return Returns a reference to this object so that method calls can be chained together. */ Builder parameterName(String parameterName); /** *

* Determines whether the parameter can be applied to any nodes, or only nodes of a particular type. *

* * @param parameterType * Determines whether the parameter can be applied to any nodes, or only nodes of a particular type. * @see ParameterType * @return Returns a reference to this object so that method calls can be chained together. * @see ParameterType */ Builder parameterType(String parameterType); /** *

* Determines whether the parameter can be applied to any nodes, or only nodes of a particular type. *

* * @param parameterType * Determines whether the parameter can be applied to any nodes, or only nodes of a particular type. * @see ParameterType * @return Returns a reference to this object so that method calls can be chained together. * @see ParameterType */ Builder parameterType(ParameterType parameterType); /** *

* The value for the parameter. *

* * @param parameterValue * The value for the parameter. * @return Returns a reference to this object so that method calls can be chained together. */ Builder parameterValue(String parameterValue); /** *

* A list of node types, and specific parameter values for each node. *

* * @param nodeTypeSpecificValues * A list of node types, and specific parameter values for each node. * @return Returns a reference to this object so that method calls can be chained together. */ Builder nodeTypeSpecificValues(Collection nodeTypeSpecificValues); /** *

* A list of node types, and specific parameter values for each node. *

* * @param nodeTypeSpecificValues * A list of node types, and specific parameter values for each node. * @return Returns a reference to this object so that method calls can be chained together. */ Builder nodeTypeSpecificValues(NodeTypeSpecificValue... nodeTypeSpecificValues); /** *

* A list of node types, and specific parameter values for each node. *

* This is a convenience method that creates an instance of the {@link List.Builder} * avoiding the need to create one manually via {@link List#builder()}. * * When the {@link Consumer} completes, {@link List.Builder#build()} is called * immediately and its result is passed to {@link #nodeTypeSpecificValues(List)}. * * @param nodeTypeSpecificValues * a consumer that will call methods on {@link List.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #nodeTypeSpecificValues(List) */ Builder nodeTypeSpecificValues(Consumer... nodeTypeSpecificValues); /** *

* A description of the parameter *

* * @param description * A description of the parameter * @return Returns a reference to this object so that method calls can be chained together. */ Builder description(String description); /** *

* How the parameter is defined. For example, system denotes a system-defined parameter. *

* * @param source * How the parameter is defined. For example, system denotes a system-defined parameter. * @return Returns a reference to this object so that method calls can be chained together. */ Builder source(String source); /** *

* The data type of the parameter. For example, integer: *

* * @param dataType * The data type of the parameter. For example, integer: * @return Returns a reference to this object so that method calls can be chained together. */ Builder dataType(String dataType); /** *

* A range of values within which the parameter can be set. *

* * @param allowedValues * A range of values within which the parameter can be set. * @return Returns a reference to this object so that method calls can be chained together. */ Builder allowedValues(String allowedValues); /** *

* Whether the customer is allowed to modify the parameter. *

* * @param isModifiable * Whether the customer is allowed to modify the parameter. * @see IsModifiable * @return Returns a reference to this object so that method calls can be chained together. * @see IsModifiable */ Builder isModifiable(String isModifiable); /** *

* Whether the customer is allowed to modify the parameter. *

* * @param isModifiable * Whether the customer is allowed to modify the parameter. * @see IsModifiable * @return Returns a reference to this object so that method calls can be chained together. * @see IsModifiable */ Builder isModifiable(IsModifiable isModifiable); /** *

* The conditions under which changes to this parameter can be applied. For example, * requires-reboot indicates that a new value for this parameter will only take effect if a node is * rebooted. *

* * @param changeType * The conditions under which changes to this parameter can be applied. For example, * requires-reboot indicates that a new value for this parameter will only take effect if a * node is rebooted. * @see ChangeType * @return Returns a reference to this object so that method calls can be chained together. * @see ChangeType */ Builder changeType(String changeType); /** *

* The conditions under which changes to this parameter can be applied. For example, * requires-reboot indicates that a new value for this parameter will only take effect if a node is * rebooted. *

* * @param changeType * The conditions under which changes to this parameter can be applied. For example, * requires-reboot indicates that a new value for this parameter will only take effect if a * node is rebooted. * @see ChangeType * @return Returns a reference to this object so that method calls can be chained together. * @see ChangeType */ Builder changeType(ChangeType changeType); } static final class BuilderImpl implements Builder { private String parameterName; private String parameterType; private String parameterValue; private List nodeTypeSpecificValues = DefaultSdkAutoConstructList.getInstance(); private String description; private String source; private String dataType; private String allowedValues; private String isModifiable; private String changeType; private BuilderImpl() { } private BuilderImpl(Parameter model) { parameterName(model.parameterName); parameterType(model.parameterType); parameterValue(model.parameterValue); nodeTypeSpecificValues(model.nodeTypeSpecificValues); description(model.description); source(model.source); dataType(model.dataType); allowedValues(model.allowedValues); isModifiable(model.isModifiable); changeType(model.changeType); } public final String getParameterName() { return parameterName; } public final void setParameterName(String parameterName) { this.parameterName = parameterName; } @Override public final Builder parameterName(String parameterName) { this.parameterName = parameterName; return this; } public final String getParameterType() { return parameterType; } public final void setParameterType(String parameterType) { this.parameterType = parameterType; } @Override public final Builder parameterType(String parameterType) { this.parameterType = parameterType; return this; } @Override public final Builder parameterType(ParameterType parameterType) { this.parameterType(parameterType == null ? null : parameterType.toString()); return this; } public final String getParameterValue() { return parameterValue; } public final void setParameterValue(String parameterValue) { this.parameterValue = parameterValue; } @Override public final Builder parameterValue(String parameterValue) { this.parameterValue = parameterValue; return this; } public final List getNodeTypeSpecificValues() { List result = NodeTypeSpecificValueListCopier .copyToBuilder(this.nodeTypeSpecificValues); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setNodeTypeSpecificValues(Collection nodeTypeSpecificValues) { this.nodeTypeSpecificValues = NodeTypeSpecificValueListCopier.copyFromBuilder(nodeTypeSpecificValues); } @Override public final Builder nodeTypeSpecificValues(Collection nodeTypeSpecificValues) { this.nodeTypeSpecificValues = NodeTypeSpecificValueListCopier.copy(nodeTypeSpecificValues); return this; } @Override @SafeVarargs public final Builder nodeTypeSpecificValues(NodeTypeSpecificValue... nodeTypeSpecificValues) { nodeTypeSpecificValues(Arrays.asList(nodeTypeSpecificValues)); return this; } @Override @SafeVarargs public final Builder nodeTypeSpecificValues(Consumer... nodeTypeSpecificValues) { nodeTypeSpecificValues(Stream.of(nodeTypeSpecificValues) .map(c -> NodeTypeSpecificValue.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; } public final String getDescription() { return description; } public final void setDescription(String description) { this.description = description; } @Override public final Builder description(String description) { this.description = description; return this; } public final String getSource() { return source; } public final void setSource(String source) { this.source = source; } @Override public final Builder source(String source) { this.source = source; return this; } public final String getDataType() { return dataType; } public final void setDataType(String dataType) { this.dataType = dataType; } @Override public final Builder dataType(String dataType) { this.dataType = dataType; return this; } public final String getAllowedValues() { return allowedValues; } public final void setAllowedValues(String allowedValues) { this.allowedValues = allowedValues; } @Override public final Builder allowedValues(String allowedValues) { this.allowedValues = allowedValues; return this; } public final String getIsModifiable() { return isModifiable; } public final void setIsModifiable(String isModifiable) { this.isModifiable = isModifiable; } @Override public final Builder isModifiable(String isModifiable) { this.isModifiable = isModifiable; return this; } @Override public final Builder isModifiable(IsModifiable isModifiable) { this.isModifiable(isModifiable == null ? null : isModifiable.toString()); return this; } public final String getChangeType() { return changeType; } public final void setChangeType(String changeType) { this.changeType = changeType; } @Override public final Builder changeType(String changeType) { this.changeType = changeType; return this; } @Override public final Builder changeType(ChangeType changeType) { this.changeType(changeType == null ? null : changeType.toString()); return this; } @Override public Parameter build() { return new Parameter(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy