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

software.amazon.awssdk.services.quicksight.model.IntegerParameterDeclaration Maven / Gradle / Ivy

/*
 * 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.quicksight.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.Consumer;
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;

/**
 * 

* A parameter declaration for the Integer data type. *

*/ @Generated("software.amazon.awssdk:codegen") public final class IntegerParameterDeclaration implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField PARAMETER_VALUE_TYPE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ParameterValueType").getter(getter(IntegerParameterDeclaration::parameterValueTypeAsString)) .setter(setter(Builder::parameterValueType)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ParameterValueType").build()) .build(); private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Name") .getter(getter(IntegerParameterDeclaration::name)).setter(setter(Builder::name)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Name").build()).build(); private static final SdkField DEFAULT_VALUES_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("DefaultValues") .getter(getter(IntegerParameterDeclaration::defaultValues)).setter(setter(Builder::defaultValues)) .constructor(IntegerDefaultValues::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DefaultValues").build()).build(); private static final SdkField VALUE_WHEN_UNSET_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("ValueWhenUnset") .getter(getter(IntegerParameterDeclaration::valueWhenUnset)).setter(setter(Builder::valueWhenUnset)) .constructor(IntegerValueWhenUnsetConfiguration::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ValueWhenUnset").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(PARAMETER_VALUE_TYPE_FIELD, NAME_FIELD, DEFAULT_VALUES_FIELD, VALUE_WHEN_UNSET_FIELD)); private static final long serialVersionUID = 1L; private final String parameterValueType; private final String name; private final IntegerDefaultValues defaultValues; private final IntegerValueWhenUnsetConfiguration valueWhenUnset; private IntegerParameterDeclaration(BuilderImpl builder) { this.parameterValueType = builder.parameterValueType; this.name = builder.name; this.defaultValues = builder.defaultValues; this.valueWhenUnset = builder.valueWhenUnset; } /** *

* The value type determines whether the parameter is a single-value or multi-value parameter. *

*

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

* * @return The value type determines whether the parameter is a single-value or multi-value parameter. * @see ParameterValueType */ public final ParameterValueType parameterValueType() { return ParameterValueType.fromValue(parameterValueType); } /** *

* The value type determines whether the parameter is a single-value or multi-value parameter. *

*

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

* * @return The value type determines whether the parameter is a single-value or multi-value parameter. * @see ParameterValueType */ public final String parameterValueTypeAsString() { return parameterValueType; } /** *

* The name of the parameter that is being declared. *

* * @return The name of the parameter that is being declared. */ public final String name() { return name; } /** *

* The default values of a parameter. If the parameter is a single-value parameter, a maximum of one default value * can be provided. *

* * @return The default values of a parameter. If the parameter is a single-value parameter, a maximum of one default * value can be provided. */ public final IntegerDefaultValues defaultValues() { return defaultValues; } /** *

* A parameter declaration for the Integer data type. *

* * @return A parameter declaration for the Integer data type. */ public final IntegerValueWhenUnsetConfiguration valueWhenUnset() { return valueWhenUnset; } @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(parameterValueTypeAsString()); hashCode = 31 * hashCode + Objects.hashCode(name()); hashCode = 31 * hashCode + Objects.hashCode(defaultValues()); hashCode = 31 * hashCode + Objects.hashCode(valueWhenUnset()); 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 IntegerParameterDeclaration)) { return false; } IntegerParameterDeclaration other = (IntegerParameterDeclaration) obj; return Objects.equals(parameterValueTypeAsString(), other.parameterValueTypeAsString()) && Objects.equals(name(), other.name()) && Objects.equals(defaultValues(), other.defaultValues()) && Objects.equals(valueWhenUnset(), other.valueWhenUnset()); } /** * 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("IntegerParameterDeclaration").add("ParameterValueType", parameterValueTypeAsString()) .add("Name", name()).add("DefaultValues", defaultValues()).add("ValueWhenUnset", valueWhenUnset()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "ParameterValueType": return Optional.ofNullable(clazz.cast(parameterValueTypeAsString())); case "Name": return Optional.ofNullable(clazz.cast(name())); case "DefaultValues": return Optional.ofNullable(clazz.cast(defaultValues())); case "ValueWhenUnset": return Optional.ofNullable(clazz.cast(valueWhenUnset())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((IntegerParameterDeclaration) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The value type determines whether the parameter is a single-value or multi-value parameter. *

* * @param parameterValueType * The value type determines whether the parameter is a single-value or multi-value parameter. * @see ParameterValueType * @return Returns a reference to this object so that method calls can be chained together. * @see ParameterValueType */ Builder parameterValueType(String parameterValueType); /** *

* The value type determines whether the parameter is a single-value or multi-value parameter. *

* * @param parameterValueType * The value type determines whether the parameter is a single-value or multi-value parameter. * @see ParameterValueType * @return Returns a reference to this object so that method calls can be chained together. * @see ParameterValueType */ Builder parameterValueType(ParameterValueType parameterValueType); /** *

* The name of the parameter that is being declared. *

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

* The default values of a parameter. If the parameter is a single-value parameter, a maximum of one default * value can be provided. *

* * @param defaultValues * The default values of a parameter. If the parameter is a single-value parameter, a maximum of one * default value can be provided. * @return Returns a reference to this object so that method calls can be chained together. */ Builder defaultValues(IntegerDefaultValues defaultValues); /** *

* The default values of a parameter. If the parameter is a single-value parameter, a maximum of one default * value can be provided. *

* This is a convenience method that creates an instance of the {@link IntegerDefaultValues.Builder} avoiding * the need to create one manually via {@link IntegerDefaultValues#builder()}. * *

* When the {@link Consumer} completes, {@link IntegerDefaultValues.Builder#build()} is called immediately and * its result is passed to {@link #defaultValues(IntegerDefaultValues)}. * * @param defaultValues * a consumer that will call methods on {@link IntegerDefaultValues.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #defaultValues(IntegerDefaultValues) */ default Builder defaultValues(Consumer defaultValues) { return defaultValues(IntegerDefaultValues.builder().applyMutation(defaultValues).build()); } /** *

* A parameter declaration for the Integer data type. *

* * @param valueWhenUnset * A parameter declaration for the Integer data type. * @return Returns a reference to this object so that method calls can be chained together. */ Builder valueWhenUnset(IntegerValueWhenUnsetConfiguration valueWhenUnset); /** *

* A parameter declaration for the Integer data type. *

* This is a convenience method that creates an instance of the * {@link IntegerValueWhenUnsetConfiguration.Builder} avoiding the need to create one manually via * {@link IntegerValueWhenUnsetConfiguration#builder()}. * *

* When the {@link Consumer} completes, {@link IntegerValueWhenUnsetConfiguration.Builder#build()} is called * immediately and its result is passed to {@link #valueWhenUnset(IntegerValueWhenUnsetConfiguration)}. * * @param valueWhenUnset * a consumer that will call methods on {@link IntegerValueWhenUnsetConfiguration.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #valueWhenUnset(IntegerValueWhenUnsetConfiguration) */ default Builder valueWhenUnset(Consumer valueWhenUnset) { return valueWhenUnset(IntegerValueWhenUnsetConfiguration.builder().applyMutation(valueWhenUnset).build()); } } static final class BuilderImpl implements Builder { private String parameterValueType; private String name; private IntegerDefaultValues defaultValues; private IntegerValueWhenUnsetConfiguration valueWhenUnset; private BuilderImpl() { } private BuilderImpl(IntegerParameterDeclaration model) { parameterValueType(model.parameterValueType); name(model.name); defaultValues(model.defaultValues); valueWhenUnset(model.valueWhenUnset); } public final String getParameterValueType() { return parameterValueType; } public final void setParameterValueType(String parameterValueType) { this.parameterValueType = parameterValueType; } @Override public final Builder parameterValueType(String parameterValueType) { this.parameterValueType = parameterValueType; return this; } @Override public final Builder parameterValueType(ParameterValueType parameterValueType) { this.parameterValueType(parameterValueType == null ? null : parameterValueType.toString()); return this; } public final String getName() { return name; } public final void setName(String name) { this.name = name; } @Override public final Builder name(String name) { this.name = name; return this; } public final IntegerDefaultValues.Builder getDefaultValues() { return defaultValues != null ? defaultValues.toBuilder() : null; } public final void setDefaultValues(IntegerDefaultValues.BuilderImpl defaultValues) { this.defaultValues = defaultValues != null ? defaultValues.build() : null; } @Override public final Builder defaultValues(IntegerDefaultValues defaultValues) { this.defaultValues = defaultValues; return this; } public final IntegerValueWhenUnsetConfiguration.Builder getValueWhenUnset() { return valueWhenUnset != null ? valueWhenUnset.toBuilder() : null; } public final void setValueWhenUnset(IntegerValueWhenUnsetConfiguration.BuilderImpl valueWhenUnset) { this.valueWhenUnset = valueWhenUnset != null ? valueWhenUnset.build() : null; } @Override public final Builder valueWhenUnset(IntegerValueWhenUnsetConfiguration valueWhenUnset) { this.valueWhenUnset = valueWhenUnset; return this; } @Override public IntegerParameterDeclaration build() { return new IntegerParameterDeclaration(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy