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

* The ID of the Data Catalog in which to create the Table. If none is supplied, the Amazon Web * Services account ID is used by default. *

*/ private String catalogId; /** *

* The catalog database in which to create the new table. For Hive compatibility, this name is entirely lowercase. *

*/ private String databaseName; /** *

* The TableInput object that defines the metadata table to create in the catalog. *

*/ private TableInput tableInput; /** *

* A list of partition indexes, PartitionIndex structures, to create in the table. *

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

* The ID of the transaction. *

*/ private String transactionId; /** *

* Specifies an OpenTableFormatInput structure when creating an open format table. *

*/ private OpenTableFormatInput openTableFormatInput; /** *

* The ID of the Data Catalog in which to create the Table. If none is supplied, the Amazon Web * Services account ID is used by default. *

* * @param catalogId * The ID of the Data Catalog in which to create the Table. If none is supplied, the Amazon Web * Services account ID is used by default. */ public void setCatalogId(String catalogId) { this.catalogId = catalogId; } /** *

* The ID of the Data Catalog in which to create the Table. If none is supplied, the Amazon Web * Services account ID is used by default. *

* * @return The ID of the Data Catalog in which to create the Table. If none is supplied, the Amazon Web * Services account ID is used by default. */ public String getCatalogId() { return this.catalogId; } /** *

* The ID of the Data Catalog in which to create the Table. If none is supplied, the Amazon Web * Services account ID is used by default. *

* * @param catalogId * The ID of the Data Catalog in which to create the Table. If none is supplied, the Amazon Web * Services account ID is used by default. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateTableRequest withCatalogId(String catalogId) { setCatalogId(catalogId); return this; } /** *

* The catalog database in which to create the new table. For Hive compatibility, this name is entirely lowercase. *

* * @param databaseName * The catalog database in which to create the new table. For Hive compatibility, this name is entirely * lowercase. */ public void setDatabaseName(String databaseName) { this.databaseName = databaseName; } /** *

* The catalog database in which to create the new table. For Hive compatibility, this name is entirely lowercase. *

* * @return The catalog database in which to create the new table. For Hive compatibility, this name is entirely * lowercase. */ public String getDatabaseName() { return this.databaseName; } /** *

* The catalog database in which to create the new table. For Hive compatibility, this name is entirely lowercase. *

* * @param databaseName * The catalog database in which to create the new table. For Hive compatibility, this name is entirely * lowercase. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateTableRequest withDatabaseName(String databaseName) { setDatabaseName(databaseName); return this; } /** *

* The TableInput object that defines the metadata table to create in the catalog. *

* * @param tableInput * The TableInput object that defines the metadata table to create in the catalog. */ public void setTableInput(TableInput tableInput) { this.tableInput = tableInput; } /** *

* The TableInput object that defines the metadata table to create in the catalog. *

* * @return The TableInput object that defines the metadata table to create in the catalog. */ public TableInput getTableInput() { return this.tableInput; } /** *

* The TableInput object that defines the metadata table to create in the catalog. *

* * @param tableInput * The TableInput object that defines the metadata table to create in the catalog. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateTableRequest withTableInput(TableInput tableInput) { setTableInput(tableInput); return this; } /** *

* A list of partition indexes, PartitionIndex structures, to create in the table. *

* * @return A list of partition indexes, PartitionIndex structures, to create in the table. */ public java.util.List getPartitionIndexes() { return partitionIndexes; } /** *

* A list of partition indexes, PartitionIndex structures, to create in the table. *

* * @param partitionIndexes * A list of partition indexes, PartitionIndex structures, to create in the table. */ public void setPartitionIndexes(java.util.Collection partitionIndexes) { if (partitionIndexes == null) { this.partitionIndexes = null; return; } this.partitionIndexes = new java.util.ArrayList(partitionIndexes); } /** *

* A list of partition indexes, PartitionIndex structures, to create in the table. *

*

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

* * @param partitionIndexes * A list of partition indexes, PartitionIndex structures, to create in the table. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateTableRequest withPartitionIndexes(PartitionIndex... partitionIndexes) { if (this.partitionIndexes == null) { setPartitionIndexes(new java.util.ArrayList(partitionIndexes.length)); } for (PartitionIndex ele : partitionIndexes) { this.partitionIndexes.add(ele); } return this; } /** *

* A list of partition indexes, PartitionIndex structures, to create in the table. *

* * @param partitionIndexes * A list of partition indexes, PartitionIndex structures, to create in the table. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateTableRequest withPartitionIndexes(java.util.Collection partitionIndexes) { setPartitionIndexes(partitionIndexes); return this; } /** *

* The ID of the transaction. *

* * @param transactionId * The ID of the transaction. */ public void setTransactionId(String transactionId) { this.transactionId = transactionId; } /** *

* The ID of the transaction. *

* * @return The ID of the transaction. */ public String getTransactionId() { return this.transactionId; } /** *

* The ID of the transaction. *

* * @param transactionId * The ID of the transaction. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateTableRequest withTransactionId(String transactionId) { setTransactionId(transactionId); return this; } /** *

* Specifies an OpenTableFormatInput structure when creating an open format table. *

* * @param openTableFormatInput * Specifies an OpenTableFormatInput structure when creating an open format table. */ public void setOpenTableFormatInput(OpenTableFormatInput openTableFormatInput) { this.openTableFormatInput = openTableFormatInput; } /** *

* Specifies an OpenTableFormatInput structure when creating an open format table. *

* * @return Specifies an OpenTableFormatInput structure when creating an open format table. */ public OpenTableFormatInput getOpenTableFormatInput() { return this.openTableFormatInput; } /** *

* Specifies an OpenTableFormatInput structure when creating an open format table. *

* * @param openTableFormatInput * Specifies an OpenTableFormatInput structure when creating an open format table. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateTableRequest withOpenTableFormatInput(OpenTableFormatInput openTableFormatInput) { setOpenTableFormatInput(openTableFormatInput); 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 (getCatalogId() != null) sb.append("CatalogId: ").append(getCatalogId()).append(","); if (getDatabaseName() != null) sb.append("DatabaseName: ").append(getDatabaseName()).append(","); if (getTableInput() != null) sb.append("TableInput: ").append(getTableInput()).append(","); if (getPartitionIndexes() != null) sb.append("PartitionIndexes: ").append(getPartitionIndexes()).append(","); if (getTransactionId() != null) sb.append("TransactionId: ").append(getTransactionId()).append(","); if (getOpenTableFormatInput() != null) sb.append("OpenTableFormatInput: ").append(getOpenTableFormatInput()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CreateTableRequest == false) return false; CreateTableRequest other = (CreateTableRequest) obj; if (other.getCatalogId() == null ^ this.getCatalogId() == null) return false; if (other.getCatalogId() != null && other.getCatalogId().equals(this.getCatalogId()) == false) return false; if (other.getDatabaseName() == null ^ this.getDatabaseName() == null) return false; if (other.getDatabaseName() != null && other.getDatabaseName().equals(this.getDatabaseName()) == false) return false; if (other.getTableInput() == null ^ this.getTableInput() == null) return false; if (other.getTableInput() != null && other.getTableInput().equals(this.getTableInput()) == false) return false; if (other.getPartitionIndexes() == null ^ this.getPartitionIndexes() == null) return false; if (other.getPartitionIndexes() != null && other.getPartitionIndexes().equals(this.getPartitionIndexes()) == false) return false; if (other.getTransactionId() == null ^ this.getTransactionId() == null) return false; if (other.getTransactionId() != null && other.getTransactionId().equals(this.getTransactionId()) == false) return false; if (other.getOpenTableFormatInput() == null ^ this.getOpenTableFormatInput() == null) return false; if (other.getOpenTableFormatInput() != null && other.getOpenTableFormatInput().equals(this.getOpenTableFormatInput()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getCatalogId() == null) ? 0 : getCatalogId().hashCode()); hashCode = prime * hashCode + ((getDatabaseName() == null) ? 0 : getDatabaseName().hashCode()); hashCode = prime * hashCode + ((getTableInput() == null) ? 0 : getTableInput().hashCode()); hashCode = prime * hashCode + ((getPartitionIndexes() == null) ? 0 : getPartitionIndexes().hashCode()); hashCode = prime * hashCode + ((getTransactionId() == null) ? 0 : getTransactionId().hashCode()); hashCode = prime * hashCode + ((getOpenTableFormatInput() == null) ? 0 : getOpenTableFormatInput().hashCode()); return hashCode; } @Override public CreateTableRequest clone() { return (CreateTableRequest) super.clone(); } }