/* * 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.timestreamquery.model; import java.io.Serializable; import javax.annotation.Generated; /** * * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class QueryResult extends com.amazonaws.AmazonWebServiceResult implements Serializable, Cloneable { /** *

* A unique ID for the given query. *

*/ private String queryId; /** *

* A pagination token that can be used again on a Query call to get the next set of results. *

*/ private String nextToken; /** *

* The result set rows returned by the query. *

*/ private java.util.List rows; /** *

* The column data types of the returned result set. *

*/ private java.util.List columnInfo; /** *

* Information about the status of the query, including progress and bytes scanned. *

*/ private QueryStatus queryStatus; /** *

* A unique ID for the given query. *

* * @param queryId * A unique ID for the given query. */ public void setQueryId(String queryId) { this.queryId = queryId; } /** *

* A unique ID for the given query. *

* * @return A unique ID for the given query. */ public String getQueryId() { return this.queryId; } /** *

* A unique ID for the given query. *

* * @param queryId * A unique ID for the given query. * @return Returns a reference to this object so that method calls can be chained together. */ public QueryResult withQueryId(String queryId) { setQueryId(queryId); return this; } /** *

* A pagination token that can be used again on a Query call to get the next set of results. *

* * @param nextToken * A pagination token that can be used again on a Query call to get the next set of results. */ public void setNextToken(String nextToken) { this.nextToken = nextToken; } /** *

* A pagination token that can be used again on a Query call to get the next set of results. *

* * @return A pagination token that can be used again on a Query call to get the next set of results. */ public String getNextToken() { return this.nextToken; } /** *

* A pagination token that can be used again on a Query call to get the next set of results. *

* * @param nextToken * A pagination token that can be used again on a Query call to get the next set of results. * @return Returns a reference to this object so that method calls can be chained together. */ public QueryResult withNextToken(String nextToken) { setNextToken(nextToken); return this; } /** *

* The result set rows returned by the query. *

* * @return The result set rows returned by the query. */ public java.util.List getRows() { return rows; } /** *

* The result set rows returned by the query. *

* * @param rows * The result set rows returned by the query. */ public void setRows(java.util.Collection rows) { if (rows == null) { this.rows = null; return; } this.rows = new java.util.ArrayList(rows); } /** *

* The result set rows returned by the query. *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setRows(java.util.Collection)} or {@link #withRows(java.util.Collection)} if you want to override the * existing values. *

* * @param rows * The result set rows returned by the query. * @return Returns a reference to this object so that method calls can be chained together. */ public QueryResult withRows(Row... rows) { if (this.rows == null) { setRows(new java.util.ArrayList(rows.length)); } for (Row ele : rows) { this.rows.add(ele); } return this; } /** *

* The result set rows returned by the query. *

* * @param rows * The result set rows returned by the query. * @return Returns a reference to this object so that method calls can be chained together. */ public QueryResult withRows(java.util.Collection rows) { setRows(rows); return this; } /** *

* The column data types of the returned result set. *

* * @return The column data types of the returned result set. */ public java.util.List getColumnInfo() { return columnInfo; } /** *

* The column data types of the returned result set. *

* * @param columnInfo * The column data types of the returned result set. */ public void setColumnInfo(java.util.Collection columnInfo) { if (columnInfo == null) { this.columnInfo = null; return; } this.columnInfo = new java.util.ArrayList(columnInfo); } /** *

* The column data types of the returned result set. *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setColumnInfo(java.util.Collection)} or {@link #withColumnInfo(java.util.Collection)} if you want to * override the existing values. *

* * @param columnInfo * The column data types of the returned result set. * @return Returns a reference to this object so that method calls can be chained together. */ public QueryResult withColumnInfo(ColumnInfo... columnInfo) { if (this.columnInfo == null) { setColumnInfo(new java.util.ArrayList(columnInfo.length)); } for (ColumnInfo ele : columnInfo) { this.columnInfo.add(ele); } return this; } /** *

* The column data types of the returned result set. *

* * @param columnInfo * The column data types of the returned result set. * @return Returns a reference to this object so that method calls can be chained together. */ public QueryResult withColumnInfo(java.util.Collection columnInfo) { setColumnInfo(columnInfo); return this; } /** *

* Information about the status of the query, including progress and bytes scanned. *

* * @param queryStatus * Information about the status of the query, including progress and bytes scanned. */ public void setQueryStatus(QueryStatus queryStatus) { this.queryStatus = queryStatus; } /** *

* Information about the status of the query, including progress and bytes scanned. *

* * @return Information about the status of the query, including progress and bytes scanned. */ public QueryStatus getQueryStatus() { return this.queryStatus; } /** *

* Information about the status of the query, including progress and bytes scanned. *

* * @param queryStatus * Information about the status of the query, including progress and bytes scanned. * @return Returns a reference to this object so that method calls can be chained together. */ public QueryResult withQueryStatus(QueryStatus queryStatus) { setQueryStatus(queryStatus); 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 (getQueryId() != null) sb.append("QueryId: ").append(getQueryId()).append(","); if (getNextToken() != null) sb.append("NextToken: ").append(getNextToken()).append(","); if (getRows() != null) sb.append("Rows: ").append(getRows()).append(","); if (getColumnInfo() != null) sb.append("ColumnInfo: ").append(getColumnInfo()).append(","); if (getQueryStatus() != null) sb.append("QueryStatus: ").append(getQueryStatus()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof QueryResult == false) return false; QueryResult other = (QueryResult) obj; if (other.getQueryId() == null ^ this.getQueryId() == null) return false; if (other.getQueryId() != null && other.getQueryId().equals(this.getQueryId()) == false) return false; if (other.getNextToken() == null ^ this.getNextToken() == null) return false; if (other.getNextToken() != null && other.getNextToken().equals(this.getNextToken()) == false) return false; if (other.getRows() == null ^ this.getRows() == null) return false; if (other.getRows() != null && other.getRows().equals(this.getRows()) == false) return false; if (other.getColumnInfo() == null ^ this.getColumnInfo() == null) return false; if (other.getColumnInfo() != null && other.getColumnInfo().equals(this.getColumnInfo()) == false) return false; if (other.getQueryStatus() == null ^ this.getQueryStatus() == null) return false; if (other.getQueryStatus() != null && other.getQueryStatus().equals(this.getQueryStatus()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getQueryId() == null) ? 0 : getQueryId().hashCode()); hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode()); hashCode = prime * hashCode + ((getRows() == null) ? 0 : getRows().hashCode()); hashCode = prime * hashCode + ((getColumnInfo() == null) ? 0 : getColumnInfo().hashCode()); hashCode = prime * hashCode + ((getQueryStatus() == null) ? 0 : getQueryStatus().hashCode()); return hashCode; } @Override public QueryResult clone() { try { return (QueryResult) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } }