com.amazonaws.services.quicksight.model.AggregationSortConfiguration Maven / Gradle / Ivy
Show all versions of aws-java-sdk-quicksight Show documentation
/*
* 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;
/**
*
* The configuration options to sort aggregated values.
*
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AggregationSortConfiguration implements Serializable, Cloneable, StructuredPojo {
/**
*
* The column that determines the sort order of aggregated values.
*
*/
private ColumnIdentifier column;
/**
*
* The sort direction of values.
*
*
* -
*
* ASC
: Sort in ascending order.
*
*
* -
*
* DESC
: Sort in descending order.
*
*
*
*/
private String sortDirection;
/**
*
* The function that aggregates the values in Column
.
*
*/
private AggregationFunction aggregationFunction;
/**
*
* The column that determines the sort order of aggregated values.
*
*
* @param column
* The column that determines the sort order of aggregated values.
*/
public void setColumn(ColumnIdentifier column) {
this.column = column;
}
/**
*
* The column that determines the sort order of aggregated values.
*
*
* @return The column that determines the sort order of aggregated values.
*/
public ColumnIdentifier getColumn() {
return this.column;
}
/**
*
* The column that determines the sort order of aggregated values.
*
*
* @param column
* The column that determines the sort order of aggregated values.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AggregationSortConfiguration withColumn(ColumnIdentifier column) {
setColumn(column);
return this;
}
/**
*
* The sort direction of values.
*
*
* -
*
* ASC
: Sort in ascending order.
*
*
* -
*
* DESC
: Sort in descending order.
*
*
*
*
* @param sortDirection
* The sort direction of values.
*
* -
*
* ASC
: Sort in ascending order.
*
*
* -
*
* DESC
: Sort in descending order.
*
*
* @see SortDirection
*/
public void setSortDirection(String sortDirection) {
this.sortDirection = sortDirection;
}
/**
*
* The sort direction of values.
*
*
* -
*
* ASC
: Sort in ascending order.
*
*
* -
*
* DESC
: Sort in descending order.
*
*
*
*
* @return The sort direction of values.
*
* -
*
* ASC
: Sort in ascending order.
*
*
* -
*
* DESC
: Sort in descending order.
*
*
* @see SortDirection
*/
public String getSortDirection() {
return this.sortDirection;
}
/**
*
* The sort direction of values.
*
*
* -
*
* ASC
: Sort in ascending order.
*
*
* -
*
* DESC
: Sort in descending order.
*
*
*
*
* @param sortDirection
* The sort direction of values.
*
* -
*
* ASC
: Sort in ascending order.
*
*
* -
*
* DESC
: Sort in descending order.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see SortDirection
*/
public AggregationSortConfiguration withSortDirection(String sortDirection) {
setSortDirection(sortDirection);
return this;
}
/**
*
* The sort direction of values.
*
*
* -
*
* ASC
: Sort in ascending order.
*
*
* -
*
* DESC
: Sort in descending order.
*
*
*
*
* @param sortDirection
* The sort direction of values.
*
* -
*
* ASC
: Sort in ascending order.
*
*
* -
*
* DESC
: Sort in descending order.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see SortDirection
*/
public AggregationSortConfiguration withSortDirection(SortDirection sortDirection) {
this.sortDirection = sortDirection.toString();
return this;
}
/**
*
* The function that aggregates the values in Column
.
*
*
* @param aggregationFunction
* The function that aggregates the values in Column
.
*/
public void setAggregationFunction(AggregationFunction aggregationFunction) {
this.aggregationFunction = aggregationFunction;
}
/**
*
* The function that aggregates the values in Column
.
*
*
* @return The function that aggregates the values in Column
.
*/
public AggregationFunction getAggregationFunction() {
return this.aggregationFunction;
}
/**
*
* The function that aggregates the values in Column
.
*
*
* @param aggregationFunction
* The function that aggregates the values in Column
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AggregationSortConfiguration withAggregationFunction(AggregationFunction aggregationFunction) {
setAggregationFunction(aggregationFunction);
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 (getColumn() != null)
sb.append("Column: ").append(getColumn()).append(",");
if (getSortDirection() != null)
sb.append("SortDirection: ").append(getSortDirection()).append(",");
if (getAggregationFunction() != null)
sb.append("AggregationFunction: ").append(getAggregationFunction());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof AggregationSortConfiguration == false)
return false;
AggregationSortConfiguration other = (AggregationSortConfiguration) obj;
if (other.getColumn() == null ^ this.getColumn() == null)
return false;
if (other.getColumn() != null && other.getColumn().equals(this.getColumn()) == false)
return false;
if (other.getSortDirection() == null ^ this.getSortDirection() == null)
return false;
if (other.getSortDirection() != null && other.getSortDirection().equals(this.getSortDirection()) == false)
return false;
if (other.getAggregationFunction() == null ^ this.getAggregationFunction() == null)
return false;
if (other.getAggregationFunction() != null && other.getAggregationFunction().equals(this.getAggregationFunction()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getColumn() == null) ? 0 : getColumn().hashCode());
hashCode = prime * hashCode + ((getSortDirection() == null) ? 0 : getSortDirection().hashCode());
hashCode = prime * hashCode + ((getAggregationFunction() == null) ? 0 : getAggregationFunction().hashCode());
return hashCode;
}
@Override
public AggregationSortConfiguration clone() {
try {
return (AggregationSortConfiguration) 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.AggregationSortConfigurationMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}