com.amazonaws.services.quicksight.model.TableSortConfiguration 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 sort configuration for a TableVisual
.
*
*
* @see AWS
* API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class TableSortConfiguration implements Serializable, Cloneable, StructuredPojo {
/**
*
* The field sort options for rows in the table.
*
*/
private java.util.List rowSort;
/**
*
* The pagination configuration (page size, page number) for the table.
*
*/
private PaginationConfiguration paginationConfiguration;
/**
*
* The field sort options for rows in the table.
*
*
* @return The field sort options for rows in the table.
*/
public java.util.List getRowSort() {
return rowSort;
}
/**
*
* The field sort options for rows in the table.
*
*
* @param rowSort
* The field sort options for rows in the table.
*/
public void setRowSort(java.util.Collection rowSort) {
if (rowSort == null) {
this.rowSort = null;
return;
}
this.rowSort = new java.util.ArrayList(rowSort);
}
/**
*
* The field sort options for rows in the table.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setRowSort(java.util.Collection)} or {@link #withRowSort(java.util.Collection)} if you want to override
* the existing values.
*
*
* @param rowSort
* The field sort options for rows in the table.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public TableSortConfiguration withRowSort(FieldSortOptions... rowSort) {
if (this.rowSort == null) {
setRowSort(new java.util.ArrayList(rowSort.length));
}
for (FieldSortOptions ele : rowSort) {
this.rowSort.add(ele);
}
return this;
}
/**
*
* The field sort options for rows in the table.
*
*
* @param rowSort
* The field sort options for rows in the table.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public TableSortConfiguration withRowSort(java.util.Collection rowSort) {
setRowSort(rowSort);
return this;
}
/**
*
* The pagination configuration (page size, page number) for the table.
*
*
* @param paginationConfiguration
* The pagination configuration (page size, page number) for the table.
*/
public void setPaginationConfiguration(PaginationConfiguration paginationConfiguration) {
this.paginationConfiguration = paginationConfiguration;
}
/**
*
* The pagination configuration (page size, page number) for the table.
*
*
* @return The pagination configuration (page size, page number) for the table.
*/
public PaginationConfiguration getPaginationConfiguration() {
return this.paginationConfiguration;
}
/**
*
* The pagination configuration (page size, page number) for the table.
*
*
* @param paginationConfiguration
* The pagination configuration (page size, page number) for the table.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public TableSortConfiguration withPaginationConfiguration(PaginationConfiguration paginationConfiguration) {
setPaginationConfiguration(paginationConfiguration);
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 (getRowSort() != null)
sb.append("RowSort: ").append(getRowSort()).append(",");
if (getPaginationConfiguration() != null)
sb.append("PaginationConfiguration: ").append(getPaginationConfiguration());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof TableSortConfiguration == false)
return false;
TableSortConfiguration other = (TableSortConfiguration) obj;
if (other.getRowSort() == null ^ this.getRowSort() == null)
return false;
if (other.getRowSort() != null && other.getRowSort().equals(this.getRowSort()) == false)
return false;
if (other.getPaginationConfiguration() == null ^ this.getPaginationConfiguration() == null)
return false;
if (other.getPaginationConfiguration() != null && other.getPaginationConfiguration().equals(this.getPaginationConfiguration()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getRowSort() == null) ? 0 : getRowSort().hashCode());
hashCode = prime * hashCode + ((getPaginationConfiguration() == null) ? 0 : getPaginationConfiguration().hashCode());
return hashCode;
}
@Override
public TableSortConfiguration clone() {
try {
return (TableSortConfiguration) 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.TableSortConfigurationMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}