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

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

Go to download

The AWS Java SDK for QuickSight module holds the client classes that are used for communicating with QuickSight.

There is a newer version: 2.28.3
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.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;

/**
 * 

* The label configuration of a reference line. *

*/ @Generated("software.amazon.awssdk:codegen") public final class ReferenceLineLabelConfiguration implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField VALUE_LABEL_CONFIGURATION_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("ValueLabelConfiguration") .getter(getter(ReferenceLineLabelConfiguration::valueLabelConfiguration)) .setter(setter(Builder::valueLabelConfiguration)).constructor(ReferenceLineValueLabelConfiguration::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ValueLabelConfiguration").build()) .build(); private static final SdkField CUSTOM_LABEL_CONFIGURATION_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("CustomLabelConfiguration") .getter(getter(ReferenceLineLabelConfiguration::customLabelConfiguration)) .setter(setter(Builder::customLabelConfiguration)).constructor(ReferenceLineCustomLabelConfiguration::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CustomLabelConfiguration").build()) .build(); private static final SdkField FONT_CONFIGURATION_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("FontConfiguration") .getter(getter(ReferenceLineLabelConfiguration::fontConfiguration)).setter(setter(Builder::fontConfiguration)) .constructor(FontConfiguration::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FontConfiguration").build()).build(); private static final SdkField FONT_COLOR_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("FontColor").getter(getter(ReferenceLineLabelConfiguration::fontColor)) .setter(setter(Builder::fontColor)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FontColor").build()).build(); private static final SdkField HORIZONTAL_POSITION_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("HorizontalPosition").getter(getter(ReferenceLineLabelConfiguration::horizontalPositionAsString)) .setter(setter(Builder::horizontalPosition)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("HorizontalPosition").build()) .build(); private static final SdkField VERTICAL_POSITION_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("VerticalPosition").getter(getter(ReferenceLineLabelConfiguration::verticalPositionAsString)) .setter(setter(Builder::verticalPosition)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("VerticalPosition").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList( VALUE_LABEL_CONFIGURATION_FIELD, CUSTOM_LABEL_CONFIGURATION_FIELD, FONT_CONFIGURATION_FIELD, FONT_COLOR_FIELD, HORIZONTAL_POSITION_FIELD, VERTICAL_POSITION_FIELD)); private static final long serialVersionUID = 1L; private final ReferenceLineValueLabelConfiguration valueLabelConfiguration; private final ReferenceLineCustomLabelConfiguration customLabelConfiguration; private final FontConfiguration fontConfiguration; private final String fontColor; private final String horizontalPosition; private final String verticalPosition; private ReferenceLineLabelConfiguration(BuilderImpl builder) { this.valueLabelConfiguration = builder.valueLabelConfiguration; this.customLabelConfiguration = builder.customLabelConfiguration; this.fontConfiguration = builder.fontConfiguration; this.fontColor = builder.fontColor; this.horizontalPosition = builder.horizontalPosition; this.verticalPosition = builder.verticalPosition; } /** *

* The value label configuration of the label in a reference line. *

* * @return The value label configuration of the label in a reference line. */ public final ReferenceLineValueLabelConfiguration valueLabelConfiguration() { return valueLabelConfiguration; } /** *

* The custom label configuration of the label in a reference line. *

* * @return The custom label configuration of the label in a reference line. */ public final ReferenceLineCustomLabelConfiguration customLabelConfiguration() { return customLabelConfiguration; } /** *

* The font configuration of the label in a reference line. *

* * @return The font configuration of the label in a reference line. */ public final FontConfiguration fontConfiguration() { return fontConfiguration; } /** *

* The font color configuration of the label in a reference line. *

* * @return The font color configuration of the label in a reference line. */ public final String fontColor() { return fontColor; } /** *

* The horizontal position configuration of the label in a reference line. Choose one of the following options: *

*
    *
  • *

    * LEFT *

    *
  • *
  • *

    * CENTER *

    *
  • *
  • *

    * RIGHT *

    *
  • *
*

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

* * @return The horizontal position configuration of the label in a reference line. Choose one of the following * options:

*
    *
  • *

    * LEFT *

    *
  • *
  • *

    * CENTER *

    *
  • *
  • *

    * RIGHT *

    *
  • * @see ReferenceLineLabelHorizontalPosition */ public final ReferenceLineLabelHorizontalPosition horizontalPosition() { return ReferenceLineLabelHorizontalPosition.fromValue(horizontalPosition); } /** *

    * The horizontal position configuration of the label in a reference line. Choose one of the following options: *

    *
      *
    • *

      * LEFT *

      *
    • *
    • *

      * CENTER *

      *
    • *
    • *

      * RIGHT *

      *
    • *
    *

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

    * * @return The horizontal position configuration of the label in a reference line. Choose one of the following * options:

    *
      *
    • *

      * LEFT *

      *
    • *
    • *

      * CENTER *

      *
    • *
    • *

      * RIGHT *

      *
    • * @see ReferenceLineLabelHorizontalPosition */ public final String horizontalPositionAsString() { return horizontalPosition; } /** *

      * The vertical position configuration of the label in a reference line. Choose one of the following options: *

      *
        *
      • *

        * ABOVE *

        *
      • *
      • *

        * BELOW *

        *
      • *
      *

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

      * * @return The vertical position configuration of the label in a reference line. Choose one of the following * options:

      *
        *
      • *

        * ABOVE *

        *
      • *
      • *

        * BELOW *

        *
      • * @see ReferenceLineLabelVerticalPosition */ public final ReferenceLineLabelVerticalPosition verticalPosition() { return ReferenceLineLabelVerticalPosition.fromValue(verticalPosition); } /** *

        * The vertical position configuration of the label in a reference line. Choose one of the following options: *

        *
          *
        • *

          * ABOVE *

          *
        • *
        • *

          * BELOW *

          *
        • *
        *

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

        * * @return The vertical position configuration of the label in a reference line. Choose one of the following * options:

        *
          *
        • *

          * ABOVE *

          *
        • *
        • *

          * BELOW *

          *
        • * @see ReferenceLineLabelVerticalPosition */ public final String verticalPositionAsString() { return verticalPosition; } @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(valueLabelConfiguration()); hashCode = 31 * hashCode + Objects.hashCode(customLabelConfiguration()); hashCode = 31 * hashCode + Objects.hashCode(fontConfiguration()); hashCode = 31 * hashCode + Objects.hashCode(fontColor()); hashCode = 31 * hashCode + Objects.hashCode(horizontalPositionAsString()); hashCode = 31 * hashCode + Objects.hashCode(verticalPositionAsString()); 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 ReferenceLineLabelConfiguration)) { return false; } ReferenceLineLabelConfiguration other = (ReferenceLineLabelConfiguration) obj; return Objects.equals(valueLabelConfiguration(), other.valueLabelConfiguration()) && Objects.equals(customLabelConfiguration(), other.customLabelConfiguration()) && Objects.equals(fontConfiguration(), other.fontConfiguration()) && Objects.equals(fontColor(), other.fontColor()) && Objects.equals(horizontalPositionAsString(), other.horizontalPositionAsString()) && Objects.equals(verticalPositionAsString(), other.verticalPositionAsString()); } /** * 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("ReferenceLineLabelConfiguration").add("ValueLabelConfiguration", valueLabelConfiguration()) .add("CustomLabelConfiguration", customLabelConfiguration()).add("FontConfiguration", fontConfiguration()) .add("FontColor", fontColor()).add("HorizontalPosition", horizontalPositionAsString()) .add("VerticalPosition", verticalPositionAsString()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "ValueLabelConfiguration": return Optional.ofNullable(clazz.cast(valueLabelConfiguration())); case "CustomLabelConfiguration": return Optional.ofNullable(clazz.cast(customLabelConfiguration())); case "FontConfiguration": return Optional.ofNullable(clazz.cast(fontConfiguration())); case "FontColor": return Optional.ofNullable(clazz.cast(fontColor())); case "HorizontalPosition": return Optional.ofNullable(clazz.cast(horizontalPositionAsString())); case "VerticalPosition": return Optional.ofNullable(clazz.cast(verticalPositionAsString())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((ReferenceLineLabelConfiguration) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

          * The value label configuration of the label in a reference line. *

          * * @param valueLabelConfiguration * The value label configuration of the label in a reference line. * @return Returns a reference to this object so that method calls can be chained together. */ Builder valueLabelConfiguration(ReferenceLineValueLabelConfiguration valueLabelConfiguration); /** *

          * The value label configuration of the label in a reference line. *

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

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

          * The custom label configuration of the label in a reference line. *

          * * @param customLabelConfiguration * The custom label configuration of the label in a reference line. * @return Returns a reference to this object so that method calls can be chained together. */ Builder customLabelConfiguration(ReferenceLineCustomLabelConfiguration customLabelConfiguration); /** *

          * The custom label configuration of the label in a reference line. *

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

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

          * The font configuration of the label in a reference line. *

          * * @param fontConfiguration * The font configuration of the label in a reference line. * @return Returns a reference to this object so that method calls can be chained together. */ Builder fontConfiguration(FontConfiguration fontConfiguration); /** *

          * The font configuration of the label in a reference line. *

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

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

          * The font color configuration of the label in a reference line. *

          * * @param fontColor * The font color configuration of the label in a reference line. * @return Returns a reference to this object so that method calls can be chained together. */ Builder fontColor(String fontColor); /** *

          * The horizontal position configuration of the label in a reference line. Choose one of the following options: *

          *
            *
          • *

            * LEFT *

            *
          • *
          • *

            * CENTER *

            *
          • *
          • *

            * RIGHT *

            *
          • *
          * * @param horizontalPosition * The horizontal position configuration of the label in a reference line. Choose one of the following * options:

          *
            *
          • *

            * LEFT *

            *
          • *
          • *

            * CENTER *

            *
          • *
          • *

            * RIGHT *

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

            * The horizontal position configuration of the label in a reference line. Choose one of the following options: *

            *
              *
            • *

              * LEFT *

              *
            • *
            • *

              * CENTER *

              *
            • *
            • *

              * RIGHT *

              *
            • *
            * * @param horizontalPosition * The horizontal position configuration of the label in a reference line. Choose one of the following * options:

            *
              *
            • *

              * LEFT *

              *
            • *
            • *

              * CENTER *

              *
            • *
            • *

              * RIGHT *

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

              * The vertical position configuration of the label in a reference line. Choose one of the following options: *

              *
                *
              • *

                * ABOVE *

                *
              • *
              • *

                * BELOW *

                *
              • *
              * * @param verticalPosition * The vertical position configuration of the label in a reference line. Choose one of the following * options:

              *
                *
              • *

                * ABOVE *

                *
              • *
              • *

                * BELOW *

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

                * The vertical position configuration of the label in a reference line. Choose one of the following options: *

                *
                  *
                • *

                  * ABOVE *

                  *
                • *
                • *

                  * BELOW *

                  *
                • *
                * * @param verticalPosition * The vertical position configuration of the label in a reference line. Choose one of the following * options:

                *
                  *
                • *

                  * ABOVE *

                  *
                • *
                • *

                  * BELOW *

                  *
                • * @see ReferenceLineLabelVerticalPosition * @return Returns a reference to this object so that method calls can be chained together. * @see ReferenceLineLabelVerticalPosition */ Builder verticalPosition(ReferenceLineLabelVerticalPosition verticalPosition); } static final class BuilderImpl implements Builder { private ReferenceLineValueLabelConfiguration valueLabelConfiguration; private ReferenceLineCustomLabelConfiguration customLabelConfiguration; private FontConfiguration fontConfiguration; private String fontColor; private String horizontalPosition; private String verticalPosition; private BuilderImpl() { } private BuilderImpl(ReferenceLineLabelConfiguration model) { valueLabelConfiguration(model.valueLabelConfiguration); customLabelConfiguration(model.customLabelConfiguration); fontConfiguration(model.fontConfiguration); fontColor(model.fontColor); horizontalPosition(model.horizontalPosition); verticalPosition(model.verticalPosition); } public final ReferenceLineValueLabelConfiguration.Builder getValueLabelConfiguration() { return valueLabelConfiguration != null ? valueLabelConfiguration.toBuilder() : null; } public final void setValueLabelConfiguration(ReferenceLineValueLabelConfiguration.BuilderImpl valueLabelConfiguration) { this.valueLabelConfiguration = valueLabelConfiguration != null ? valueLabelConfiguration.build() : null; } @Override public final Builder valueLabelConfiguration(ReferenceLineValueLabelConfiguration valueLabelConfiguration) { this.valueLabelConfiguration = valueLabelConfiguration; return this; } public final ReferenceLineCustomLabelConfiguration.Builder getCustomLabelConfiguration() { return customLabelConfiguration != null ? customLabelConfiguration.toBuilder() : null; } public final void setCustomLabelConfiguration(ReferenceLineCustomLabelConfiguration.BuilderImpl customLabelConfiguration) { this.customLabelConfiguration = customLabelConfiguration != null ? customLabelConfiguration.build() : null; } @Override public final Builder customLabelConfiguration(ReferenceLineCustomLabelConfiguration customLabelConfiguration) { this.customLabelConfiguration = customLabelConfiguration; return this; } public final FontConfiguration.Builder getFontConfiguration() { return fontConfiguration != null ? fontConfiguration.toBuilder() : null; } public final void setFontConfiguration(FontConfiguration.BuilderImpl fontConfiguration) { this.fontConfiguration = fontConfiguration != null ? fontConfiguration.build() : null; } @Override public final Builder fontConfiguration(FontConfiguration fontConfiguration) { this.fontConfiguration = fontConfiguration; return this; } public final String getFontColor() { return fontColor; } public final void setFontColor(String fontColor) { this.fontColor = fontColor; } @Override public final Builder fontColor(String fontColor) { this.fontColor = fontColor; return this; } public final String getHorizontalPosition() { return horizontalPosition; } public final void setHorizontalPosition(String horizontalPosition) { this.horizontalPosition = horizontalPosition; } @Override public final Builder horizontalPosition(String horizontalPosition) { this.horizontalPosition = horizontalPosition; return this; } @Override public final Builder horizontalPosition(ReferenceLineLabelHorizontalPosition horizontalPosition) { this.horizontalPosition(horizontalPosition == null ? null : horizontalPosition.toString()); return this; } public final String getVerticalPosition() { return verticalPosition; } public final void setVerticalPosition(String verticalPosition) { this.verticalPosition = verticalPosition; } @Override public final Builder verticalPosition(String verticalPosition) { this.verticalPosition = verticalPosition; return this; } @Override public final Builder verticalPosition(ReferenceLineLabelVerticalPosition verticalPosition) { this.verticalPosition(verticalPosition == null ? null : verticalPosition.toString()); return this; } @Override public ReferenceLineLabelConfiguration build() { return new ReferenceLineLabelConfiguration(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy