software.amazon.awssdk.services.quicksight.model.ReferenceLineLabelConfiguration Maven / Gradle / Ivy
Show all versions of quicksight 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.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