software.amazon.awssdk.services.quicksight.model.BoxPlotChartConfiguration 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.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;
/**
*
* The configuration of a BoxPlotVisual
.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class BoxPlotChartConfiguration implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField FIELD_WELLS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("FieldWells")
.getter(getter(BoxPlotChartConfiguration::fieldWells)).setter(setter(Builder::fieldWells))
.constructor(BoxPlotFieldWells::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FieldWells").build()).build();
private static final SdkField SORT_CONFIGURATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("SortConfiguration")
.getter(getter(BoxPlotChartConfiguration::sortConfiguration)).setter(setter(Builder::sortConfiguration))
.constructor(BoxPlotSortConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SortConfiguration").build()).build();
private static final SdkField BOX_PLOT_OPTIONS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("BoxPlotOptions")
.getter(getter(BoxPlotChartConfiguration::boxPlotOptions)).setter(setter(Builder::boxPlotOptions))
.constructor(BoxPlotOptions::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BoxPlotOptions").build()).build();
private static final SdkField CATEGORY_AXIS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("CategoryAxis")
.getter(getter(BoxPlotChartConfiguration::categoryAxis)).setter(setter(Builder::categoryAxis))
.constructor(AxisDisplayOptions::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CategoryAxis").build()).build();
private static final SdkField CATEGORY_LABEL_OPTIONS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("CategoryLabelOptions")
.getter(getter(BoxPlotChartConfiguration::categoryLabelOptions)).setter(setter(Builder::categoryLabelOptions))
.constructor(ChartAxisLabelOptions::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CategoryLabelOptions").build())
.build();
private static final SdkField PRIMARY_Y_AXIS_DISPLAY_OPTIONS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.memberName("PrimaryYAxisDisplayOptions")
.getter(getter(BoxPlotChartConfiguration::primaryYAxisDisplayOptions))
.setter(setter(Builder::primaryYAxisDisplayOptions))
.constructor(AxisDisplayOptions::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PrimaryYAxisDisplayOptions").build())
.build();
private static final SdkField PRIMARY_Y_AXIS_LABEL_OPTIONS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("PrimaryYAxisLabelOptions")
.getter(getter(BoxPlotChartConfiguration::primaryYAxisLabelOptions))
.setter(setter(Builder::primaryYAxisLabelOptions)).constructor(ChartAxisLabelOptions::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PrimaryYAxisLabelOptions").build())
.build();
private static final SdkField LEGEND_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("Legend").getter(getter(BoxPlotChartConfiguration::legend)).setter(setter(Builder::legend))
.constructor(LegendOptions::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Legend").build()).build();
private static final SdkField TOOLTIP_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("Tooltip").getter(getter(BoxPlotChartConfiguration::tooltip)).setter(setter(Builder::tooltip))
.constructor(TooltipOptions::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Tooltip").build()).build();
private static final SdkField> REFERENCE_LINES_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("ReferenceLines")
.getter(getter(BoxPlotChartConfiguration::referenceLines))
.setter(setter(Builder::referenceLines))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ReferenceLines").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(ReferenceLine::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField VISUAL_PALETTE_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("VisualPalette")
.getter(getter(BoxPlotChartConfiguration::visualPalette)).setter(setter(Builder::visualPalette))
.constructor(VisualPalette::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("VisualPalette").build()).build();
private static final SdkField INTERACTIONS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("Interactions")
.getter(getter(BoxPlotChartConfiguration::interactions)).setter(setter(Builder::interactions))
.constructor(VisualInteractionOptions::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Interactions").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(FIELD_WELLS_FIELD,
SORT_CONFIGURATION_FIELD, BOX_PLOT_OPTIONS_FIELD, CATEGORY_AXIS_FIELD, CATEGORY_LABEL_OPTIONS_FIELD,
PRIMARY_Y_AXIS_DISPLAY_OPTIONS_FIELD, PRIMARY_Y_AXIS_LABEL_OPTIONS_FIELD, LEGEND_FIELD, TOOLTIP_FIELD,
REFERENCE_LINES_FIELD, VISUAL_PALETTE_FIELD, INTERACTIONS_FIELD));
private static final long serialVersionUID = 1L;
private final BoxPlotFieldWells fieldWells;
private final BoxPlotSortConfiguration sortConfiguration;
private final BoxPlotOptions boxPlotOptions;
private final AxisDisplayOptions categoryAxis;
private final ChartAxisLabelOptions categoryLabelOptions;
private final AxisDisplayOptions primaryYAxisDisplayOptions;
private final ChartAxisLabelOptions primaryYAxisLabelOptions;
private final LegendOptions legend;
private final TooltipOptions tooltip;
private final List referenceLines;
private final VisualPalette visualPalette;
private final VisualInteractionOptions interactions;
private BoxPlotChartConfiguration(BuilderImpl builder) {
this.fieldWells = builder.fieldWells;
this.sortConfiguration = builder.sortConfiguration;
this.boxPlotOptions = builder.boxPlotOptions;
this.categoryAxis = builder.categoryAxis;
this.categoryLabelOptions = builder.categoryLabelOptions;
this.primaryYAxisDisplayOptions = builder.primaryYAxisDisplayOptions;
this.primaryYAxisLabelOptions = builder.primaryYAxisLabelOptions;
this.legend = builder.legend;
this.tooltip = builder.tooltip;
this.referenceLines = builder.referenceLines;
this.visualPalette = builder.visualPalette;
this.interactions = builder.interactions;
}
/**
*
* The field wells of the visual.
*
*
* @return The field wells of the visual.
*/
public final BoxPlotFieldWells fieldWells() {
return fieldWells;
}
/**
*
* The sort configuration of a BoxPlotVisual
.
*
*
* @return The sort configuration of a BoxPlotVisual
.
*/
public final BoxPlotSortConfiguration sortConfiguration() {
return sortConfiguration;
}
/**
*
* The box plot chart options for a box plot visual
*
*
* @return The box plot chart options for a box plot visual
*/
public final BoxPlotOptions boxPlotOptions() {
return boxPlotOptions;
}
/**
*
* The label display options (grid line, range, scale, axis step) of a box plot category.
*
*
* @return The label display options (grid line, range, scale, axis step) of a box plot category.
*/
public final AxisDisplayOptions categoryAxis() {
return categoryAxis;
}
/**
*
* The label options (label text, label visibility and sort Icon visibility) of a box plot category.
*
*
* @return The label options (label text, label visibility and sort Icon visibility) of a box plot category.
*/
public final ChartAxisLabelOptions categoryLabelOptions() {
return categoryLabelOptions;
}
/**
*
* The label display options (grid line, range, scale, axis step) of a box plot category.
*
*
* @return The label display options (grid line, range, scale, axis step) of a box plot category.
*/
public final AxisDisplayOptions primaryYAxisDisplayOptions() {
return primaryYAxisDisplayOptions;
}
/**
*
* The label options (label text, label visibility and sort icon visibility) of a box plot value.
*
*
* @return The label options (label text, label visibility and sort icon visibility) of a box plot value.
*/
public final ChartAxisLabelOptions primaryYAxisLabelOptions() {
return primaryYAxisLabelOptions;
}
/**
* Returns the value of the Legend property for this object.
*
* @return The value of the Legend property for this object.
*/
public final LegendOptions legend() {
return legend;
}
/**
*
* The tooltip display setup of the visual.
*
*
* @return The tooltip display setup of the visual.
*/
public final TooltipOptions tooltip() {
return tooltip;
}
/**
* For responses, this returns true if the service returned a value for the ReferenceLines 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 hasReferenceLines() {
return referenceLines != null && !(referenceLines instanceof SdkAutoConstructList);
}
/**
*
* The reference line setup of the visual.
*
*
* 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 #hasReferenceLines} method.
*
*
* @return The reference line setup of the visual.
*/
public final List referenceLines() {
return referenceLines;
}
/**
*
* The palette (chart color) display setup of the visual.
*
*
* @return The palette (chart color) display setup of the visual.
*/
public final VisualPalette visualPalette() {
return visualPalette;
}
/**
*
* The general visual interactions setup for a visual.
*
*
* @return The general visual interactions setup for a visual.
*/
public final VisualInteractionOptions interactions() {
return interactions;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(fieldWells());
hashCode = 31 * hashCode + Objects.hashCode(sortConfiguration());
hashCode = 31 * hashCode + Objects.hashCode(boxPlotOptions());
hashCode = 31 * hashCode + Objects.hashCode(categoryAxis());
hashCode = 31 * hashCode + Objects.hashCode(categoryLabelOptions());
hashCode = 31 * hashCode + Objects.hashCode(primaryYAxisDisplayOptions());
hashCode = 31 * hashCode + Objects.hashCode(primaryYAxisLabelOptions());
hashCode = 31 * hashCode + Objects.hashCode(legend());
hashCode = 31 * hashCode + Objects.hashCode(tooltip());
hashCode = 31 * hashCode + Objects.hashCode(hasReferenceLines() ? referenceLines() : null);
hashCode = 31 * hashCode + Objects.hashCode(visualPalette());
hashCode = 31 * hashCode + Objects.hashCode(interactions());
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 BoxPlotChartConfiguration)) {
return false;
}
BoxPlotChartConfiguration other = (BoxPlotChartConfiguration) obj;
return Objects.equals(fieldWells(), other.fieldWells()) && Objects.equals(sortConfiguration(), other.sortConfiguration())
&& Objects.equals(boxPlotOptions(), other.boxPlotOptions())
&& Objects.equals(categoryAxis(), other.categoryAxis())
&& Objects.equals(categoryLabelOptions(), other.categoryLabelOptions())
&& Objects.equals(primaryYAxisDisplayOptions(), other.primaryYAxisDisplayOptions())
&& Objects.equals(primaryYAxisLabelOptions(), other.primaryYAxisLabelOptions())
&& Objects.equals(legend(), other.legend()) && Objects.equals(tooltip(), other.tooltip())
&& hasReferenceLines() == other.hasReferenceLines() && Objects.equals(referenceLines(), other.referenceLines())
&& Objects.equals(visualPalette(), other.visualPalette()) && Objects.equals(interactions(), other.interactions());
}
/**
* 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("BoxPlotChartConfiguration").add("FieldWells", fieldWells())
.add("SortConfiguration", sortConfiguration()).add("BoxPlotOptions", boxPlotOptions())
.add("CategoryAxis", categoryAxis()).add("CategoryLabelOptions", categoryLabelOptions())
.add("PrimaryYAxisDisplayOptions", primaryYAxisDisplayOptions())
.add("PrimaryYAxisLabelOptions", primaryYAxisLabelOptions()).add("Legend", legend()).add("Tooltip", tooltip())
.add("ReferenceLines", hasReferenceLines() ? referenceLines() : null).add("VisualPalette", visualPalette())
.add("Interactions", interactions()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "FieldWells":
return Optional.ofNullable(clazz.cast(fieldWells()));
case "SortConfiguration":
return Optional.ofNullable(clazz.cast(sortConfiguration()));
case "BoxPlotOptions":
return Optional.ofNullable(clazz.cast(boxPlotOptions()));
case "CategoryAxis":
return Optional.ofNullable(clazz.cast(categoryAxis()));
case "CategoryLabelOptions":
return Optional.ofNullable(clazz.cast(categoryLabelOptions()));
case "PrimaryYAxisDisplayOptions":
return Optional.ofNullable(clazz.cast(primaryYAxisDisplayOptions()));
case "PrimaryYAxisLabelOptions":
return Optional.ofNullable(clazz.cast(primaryYAxisLabelOptions()));
case "Legend":
return Optional.ofNullable(clazz.cast(legend()));
case "Tooltip":
return Optional.ofNullable(clazz.cast(tooltip()));
case "ReferenceLines":
return Optional.ofNullable(clazz.cast(referenceLines()));
case "VisualPalette":
return Optional.ofNullable(clazz.cast(visualPalette()));
case "Interactions":
return Optional.ofNullable(clazz.cast(interactions()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function