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

software.amazon.awssdk.services.quicksight.model.DecimalValueWhenUnsetConfiguration 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.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;

/**
 * 

* The configuration that defines the default value of a Decimal parameter when a value has not been set. *

*/ @Generated("software.amazon.awssdk:codegen") public final class DecimalValueWhenUnsetConfiguration implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField VALUE_WHEN_UNSET_OPTION_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ValueWhenUnsetOption").getter(getter(DecimalValueWhenUnsetConfiguration::valueWhenUnsetOptionAsString)) .setter(setter(Builder::valueWhenUnsetOption)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ValueWhenUnsetOption").build()) .build(); private static final SdkField CUSTOM_VALUE_FIELD = SdkField. builder(MarshallingType.DOUBLE) .memberName("CustomValue").getter(getter(DecimalValueWhenUnsetConfiguration::customValue)) .setter(setter(Builder::customValue)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CustomValue").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(VALUE_WHEN_UNSET_OPTION_FIELD, CUSTOM_VALUE_FIELD)); private static final long serialVersionUID = 1L; private final String valueWhenUnsetOption; private final Double customValue; private DecimalValueWhenUnsetConfiguration(BuilderImpl builder) { this.valueWhenUnsetOption = builder.valueWhenUnsetOption; this.customValue = builder.customValue; } /** *

* The built-in options for default values. The value can be one of the following: *

*
    *
  • *

    * RECOMMENDED: The recommended value. *

    *
  • *
  • *

    * NULL: The NULL value. *

    *
  • *
*

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

* * @return The built-in options for default values. The value can be one of the following:

*
    *
  • *

    * RECOMMENDED: The recommended value. *

    *
  • *
  • *

    * NULL: The NULL value. *

    *
  • * @see ValueWhenUnsetOption */ public final ValueWhenUnsetOption valueWhenUnsetOption() { return ValueWhenUnsetOption.fromValue(valueWhenUnsetOption); } /** *

    * The built-in options for default values. The value can be one of the following: *

    *
      *
    • *

      * RECOMMENDED: The recommended value. *

      *
    • *
    • *

      * NULL: The NULL value. *

      *
    • *
    *

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

    * * @return The built-in options for default values. The value can be one of the following:

    *
      *
    • *

      * RECOMMENDED: The recommended value. *

      *
    • *
    • *

      * NULL: The NULL value. *

      *
    • * @see ValueWhenUnsetOption */ public final String valueWhenUnsetOptionAsString() { return valueWhenUnsetOption; } /** *

      * A custom value that's used when the value of a parameter isn't set. *

      * * @return A custom value that's used when the value of a parameter isn't set. */ public final Double customValue() { return customValue; } @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(valueWhenUnsetOptionAsString()); hashCode = 31 * hashCode + Objects.hashCode(customValue()); 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 DecimalValueWhenUnsetConfiguration)) { return false; } DecimalValueWhenUnsetConfiguration other = (DecimalValueWhenUnsetConfiguration) obj; return Objects.equals(valueWhenUnsetOptionAsString(), other.valueWhenUnsetOptionAsString()) && Objects.equals(customValue(), other.customValue()); } /** * 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("DecimalValueWhenUnsetConfiguration").add("ValueWhenUnsetOption", valueWhenUnsetOptionAsString()) .add("CustomValue", customValue() == null ? null : "*** Sensitive Data Redacted ***").build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "ValueWhenUnsetOption": return Optional.ofNullable(clazz.cast(valueWhenUnsetOptionAsString())); case "CustomValue": return Optional.ofNullable(clazz.cast(customValue())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((DecimalValueWhenUnsetConfiguration) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

      * The built-in options for default values. The value can be one of the following: *

      *
        *
      • *

        * RECOMMENDED: The recommended value. *

        *
      • *
      • *

        * NULL: The NULL value. *

        *
      • *
      * * @param valueWhenUnsetOption * The built-in options for default values. The value can be one of the following:

      *
        *
      • *

        * RECOMMENDED: The recommended value. *

        *
      • *
      • *

        * NULL: The NULL value. *

        *
      • * @see ValueWhenUnsetOption * @return Returns a reference to this object so that method calls can be chained together. * @see ValueWhenUnsetOption */ Builder valueWhenUnsetOption(String valueWhenUnsetOption); /** *

        * The built-in options for default values. The value can be one of the following: *

        *
          *
        • *

          * RECOMMENDED: The recommended value. *

          *
        • *
        • *

          * NULL: The NULL value. *

          *
        • *
        * * @param valueWhenUnsetOption * The built-in options for default values. The value can be one of the following:

        *
          *
        • *

          * RECOMMENDED: The recommended value. *

          *
        • *
        • *

          * NULL: The NULL value. *

          *
        • * @see ValueWhenUnsetOption * @return Returns a reference to this object so that method calls can be chained together. * @see ValueWhenUnsetOption */ Builder valueWhenUnsetOption(ValueWhenUnsetOption valueWhenUnsetOption); /** *

          * A custom value that's used when the value of a parameter isn't set. *

          * * @param customValue * A custom value that's used when the value of a parameter isn't set. * @return Returns a reference to this object so that method calls can be chained together. */ Builder customValue(Double customValue); } static final class BuilderImpl implements Builder { private String valueWhenUnsetOption; private Double customValue; private BuilderImpl() { } private BuilderImpl(DecimalValueWhenUnsetConfiguration model) { valueWhenUnsetOption(model.valueWhenUnsetOption); customValue(model.customValue); } public final String getValueWhenUnsetOption() { return valueWhenUnsetOption; } public final void setValueWhenUnsetOption(String valueWhenUnsetOption) { this.valueWhenUnsetOption = valueWhenUnsetOption; } @Override public final Builder valueWhenUnsetOption(String valueWhenUnsetOption) { this.valueWhenUnsetOption = valueWhenUnsetOption; return this; } @Override public final Builder valueWhenUnsetOption(ValueWhenUnsetOption valueWhenUnsetOption) { this.valueWhenUnsetOption(valueWhenUnsetOption == null ? null : valueWhenUnsetOption.toString()); return this; } public final Double getCustomValue() { return customValue; } public final void setCustomValue(Double customValue) { this.customValue = customValue; } @Override public final Builder customValue(Double customValue) { this.customValue = customValue; return this; } @Override public DecimalValueWhenUnsetConfiguration build() { return new DecimalValueWhenUnsetConfiguration(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy