/* * Copyright 2018-2023 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 com.amazonaws.services.quicksight.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* An aggregation function aggregates values from a dimension or measure. *
** This is a union type structure. For this structure to be valid, only one of the attributes can be defined. *
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class AggregationFunction implements Serializable, Cloneable, StructuredPojo { /** ** Aggregation for numerical values. *
*/ private NumericalAggregationFunction numericalAggregationFunction; /** ** Aggregation for categorical values. *
*
* COUNT
: Aggregate by the total number of values, including duplicates.
*
* DISTINCT_COUNT
: Aggregate by the total number of distinct values.
*
* Aggregation for date values. *
*
* COUNT
: Aggregate by the total number of values, including duplicates.
*
* DISTINCT_COUNT
: Aggregate by the total number of distinct values.
*
* MIN
: Select the smallest date value.
*
* MAX
: Select the largest date value.
*
* Aggregation for attributes. *
*/ private AttributeAggregationFunction attributeAggregationFunction; /** ** Aggregation for numerical values. *
* * @param numericalAggregationFunction * Aggregation for numerical values. */ public void setNumericalAggregationFunction(NumericalAggregationFunction numericalAggregationFunction) { this.numericalAggregationFunction = numericalAggregationFunction; } /** ** Aggregation for numerical values. *
* * @return Aggregation for numerical values. */ public NumericalAggregationFunction getNumericalAggregationFunction() { return this.numericalAggregationFunction; } /** ** Aggregation for numerical values. *
* * @param numericalAggregationFunction * Aggregation for numerical values. * @return Returns a reference to this object so that method calls can be chained together. */ public AggregationFunction withNumericalAggregationFunction(NumericalAggregationFunction numericalAggregationFunction) { setNumericalAggregationFunction(numericalAggregationFunction); return this; } /** ** Aggregation for categorical values. *
*
* COUNT
: Aggregate by the total number of values, including duplicates.
*
* DISTINCT_COUNT
: Aggregate by the total number of distinct values.
*
* COUNT
: Aggregate by the total number of values, including duplicates.
*
* DISTINCT_COUNT
: Aggregate by the total number of distinct values.
*
* Aggregation for categorical values. *
*
* COUNT
: Aggregate by the total number of values, including duplicates.
*
* DISTINCT_COUNT
: Aggregate by the total number of distinct values.
*
* COUNT
: Aggregate by the total number of values, including duplicates.
*
* DISTINCT_COUNT
: Aggregate by the total number of distinct values.
*
* Aggregation for categorical values. *
*
* COUNT
: Aggregate by the total number of values, including duplicates.
*
* DISTINCT_COUNT
: Aggregate by the total number of distinct values.
*
* COUNT
: Aggregate by the total number of values, including duplicates.
*
* DISTINCT_COUNT
: Aggregate by the total number of distinct values.
*
* Aggregation for categorical values. *
*
* COUNT
: Aggregate by the total number of values, including duplicates.
*
* DISTINCT_COUNT
: Aggregate by the total number of distinct values.
*
* COUNT
: Aggregate by the total number of values, including duplicates.
*
* DISTINCT_COUNT
: Aggregate by the total number of distinct values.
*
* Aggregation for date values. *
*
* COUNT
: Aggregate by the total number of values, including duplicates.
*
* DISTINCT_COUNT
: Aggregate by the total number of distinct values.
*
* MIN
: Select the smallest date value.
*
* MAX
: Select the largest date value.
*
* COUNT
: Aggregate by the total number of values, including duplicates.
*
* DISTINCT_COUNT
: Aggregate by the total number of distinct values.
*
* MIN
: Select the smallest date value.
*
* MAX
: Select the largest date value.
*
* Aggregation for date values. *
*
* COUNT
: Aggregate by the total number of values, including duplicates.
*
* DISTINCT_COUNT
: Aggregate by the total number of distinct values.
*
* MIN
: Select the smallest date value.
*
* MAX
: Select the largest date value.
*
* COUNT
: Aggregate by the total number of values, including duplicates.
*
* DISTINCT_COUNT
: Aggregate by the total number of distinct values.
*
* MIN
: Select the smallest date value.
*
* MAX
: Select the largest date value.
*
* Aggregation for date values. *
*
* COUNT
: Aggregate by the total number of values, including duplicates.
*
* DISTINCT_COUNT
: Aggregate by the total number of distinct values.
*
* MIN
: Select the smallest date value.
*
* MAX
: Select the largest date value.
*
* COUNT
: Aggregate by the total number of values, including duplicates.
*
* DISTINCT_COUNT
: Aggregate by the total number of distinct values.
*
* MIN
: Select the smallest date value.
*
* MAX
: Select the largest date value.
*
* Aggregation for date values. *
*
* COUNT
: Aggregate by the total number of values, including duplicates.
*
* DISTINCT_COUNT
: Aggregate by the total number of distinct values.
*
* MIN
: Select the smallest date value.
*
* MAX
: Select the largest date value.
*
* COUNT
: Aggregate by the total number of values, including duplicates.
*
* DISTINCT_COUNT
: Aggregate by the total number of distinct values.
*
* MIN
: Select the smallest date value.
*
* MAX
: Select the largest date value.
*
* Aggregation for attributes. *
* * @param attributeAggregationFunction * Aggregation for attributes. */ public void setAttributeAggregationFunction(AttributeAggregationFunction attributeAggregationFunction) { this.attributeAggregationFunction = attributeAggregationFunction; } /** ** Aggregation for attributes. *
* * @return Aggregation for attributes. */ public AttributeAggregationFunction getAttributeAggregationFunction() { return this.attributeAggregationFunction; } /** ** Aggregation for attributes. *
* * @param attributeAggregationFunction * Aggregation for attributes. * @return Returns a reference to this object so that method calls can be chained together. */ public AggregationFunction withAttributeAggregationFunction(AttributeAggregationFunction attributeAggregationFunction) { setAttributeAggregationFunction(attributeAggregationFunction); return this; } /** * 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. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getNumericalAggregationFunction() != null) sb.append("NumericalAggregationFunction: ").append(getNumericalAggregationFunction()).append(","); if (getCategoricalAggregationFunction() != null) sb.append("CategoricalAggregationFunction: ").append(getCategoricalAggregationFunction()).append(","); if (getDateAggregationFunction() != null) sb.append("DateAggregationFunction: ").append(getDateAggregationFunction()).append(","); if (getAttributeAggregationFunction() != null) sb.append("AttributeAggregationFunction: ").append(getAttributeAggregationFunction()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof AggregationFunction == false) return false; AggregationFunction other = (AggregationFunction) obj; if (other.getNumericalAggregationFunction() == null ^ this.getNumericalAggregationFunction() == null) return false; if (other.getNumericalAggregationFunction() != null && other.getNumericalAggregationFunction().equals(this.getNumericalAggregationFunction()) == false) return false; if (other.getCategoricalAggregationFunction() == null ^ this.getCategoricalAggregationFunction() == null) return false; if (other.getCategoricalAggregationFunction() != null && other.getCategoricalAggregationFunction().equals(this.getCategoricalAggregationFunction()) == false) return false; if (other.getDateAggregationFunction() == null ^ this.getDateAggregationFunction() == null) return false; if (other.getDateAggregationFunction() != null && other.getDateAggregationFunction().equals(this.getDateAggregationFunction()) == false) return false; if (other.getAttributeAggregationFunction() == null ^ this.getAttributeAggregationFunction() == null) return false; if (other.getAttributeAggregationFunction() != null && other.getAttributeAggregationFunction().equals(this.getAttributeAggregationFunction()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getNumericalAggregationFunction() == null) ? 0 : getNumericalAggregationFunction().hashCode()); hashCode = prime * hashCode + ((getCategoricalAggregationFunction() == null) ? 0 : getCategoricalAggregationFunction().hashCode()); hashCode = prime * hashCode + ((getDateAggregationFunction() == null) ? 0 : getDateAggregationFunction().hashCode()); hashCode = prime * hashCode + ((getAttributeAggregationFunction() == null) ? 0 : getAttributeAggregationFunction().hashCode()); return hashCode; } @Override public AggregationFunction clone() { try { return (AggregationFunction) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } @com.amazonaws.annotation.SdkInternalApi @Override public void marshall(ProtocolMarshaller protocolMarshaller) { com.amazonaws.services.quicksight.model.transform.AggregationFunctionMarshaller.getInstance().marshall(this, protocolMarshaller); } }