/* * 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.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *

* A structure used to define a table. *

* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class TableInput implements Serializable, Cloneable, StructuredPojo { /** *

* The table name. For Hive compatibility, this is folded to lowercase when it is stored. *

*/ private String name; /** *

* A description of the table. *

*/ private String description; /** *

* The table owner. Included for Apache Hive compatibility. Not used in the normal course of Glue operations. *

*/ private String owner; /** *

* The last time that the table was accessed. *

*/ private java.util.Date lastAccessTime; /** *

* The last time that column statistics were computed for this table. *

*/ private java.util.Date lastAnalyzedTime; /** *

* The retention time for this table. *

*/ private Integer retention; /** *

* A storage descriptor containing information about the physical storage of this table. *

*/ private StorageDescriptor storageDescriptor; /** *

* A list of columns by which the table is partitioned. Only primitive types are supported as partition keys. *

*

* When you create a table used by Amazon Athena, and you do not specify any partitionKeys, you must at * least set the value of partitionKeys to an empty list. For example: *

*

* "PartitionKeys": [] *

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

* Included for Apache Hive compatibility. Not used in the normal course of Glue operations. If the table is a * VIRTUAL_VIEW, certain Athena configuration encoded in base64. *

*/ private String viewOriginalText; /** *

* Included for Apache Hive compatibility. Not used in the normal course of Glue operations. *

*/ private String viewExpandedText; /** *

* The type of this table. Glue will create tables with the EXTERNAL_TABLE type. Other services, such * as Athena, may create tables with additional table types. *

*

* Glue related table types: *

*
*
EXTERNAL_TABLE
*
*

* Hive compatible attribute - indicates a non-Hive managed table. *

*
*
GOVERNED
*
*

* Used by Lake Formation. The Glue Data Catalog understands GOVERNED. *

*
*
*/ private String tableType; /** *

* These key-value pairs define properties associated with the table. *

*/ private java.util.Map parameters; /** *

* A TableIdentifier structure that describes a target table for resource linking. *

*/ private TableIdentifier targetTable; /** *

* The table name. For Hive compatibility, this is folded to lowercase when it is stored. *

* * @param name * The table name. For Hive compatibility, this is folded to lowercase when it is stored. */ public void setName(String name) { this.name = name; } /** *

* The table name. For Hive compatibility, this is folded to lowercase when it is stored. *

* * @return The table name. For Hive compatibility, this is folded to lowercase when it is stored. */ public String getName() { return this.name; } /** *

* The table name. For Hive compatibility, this is folded to lowercase when it is stored. *

* * @param name * The table name. For Hive compatibility, this is folded to lowercase when it is stored. * @return Returns a reference to this object so that method calls can be chained together. */ public TableInput withName(String name) { setName(name); return this; } /** *

* A description of the table. *

* * @param description * A description of the table. */ public void setDescription(String description) { this.description = description; } /** *

* A description of the table. *

* * @return A description of the table. */ public String getDescription() { return this.description; } /** *

* A description of the table. *

* * @param description * A description of the table. * @return Returns a reference to this object so that method calls can be chained together. */ public TableInput withDescription(String description) { setDescription(description); return this; } /** *

* The table owner. Included for Apache Hive compatibility. Not used in the normal course of Glue operations. *

* * @param owner * The table owner. Included for Apache Hive compatibility. Not used in the normal course of Glue operations. */ public void setOwner(String owner) { this.owner = owner; } /** *

* The table owner. Included for Apache Hive compatibility. Not used in the normal course of Glue operations. *

* * @return The table owner. Included for Apache Hive compatibility. Not used in the normal course of Glue * operations. */ public String getOwner() { return this.owner; } /** *

* The table owner. Included for Apache Hive compatibility. Not used in the normal course of Glue operations. *

* * @param owner * The table owner. Included for Apache Hive compatibility. Not used in the normal course of Glue operations. * @return Returns a reference to this object so that method calls can be chained together. */ public TableInput withOwner(String owner) { setOwner(owner); return this; } /** *

* The last time that the table was accessed. *

* * @param lastAccessTime * The last time that the table was accessed. */ public void setLastAccessTime(java.util.Date lastAccessTime) { this.lastAccessTime = lastAccessTime; } /** *

* The last time that the table was accessed. *

* * @return The last time that the table was accessed. */ public java.util.Date getLastAccessTime() { return this.lastAccessTime; } /** *

* The last time that the table was accessed. *

* * @param lastAccessTime * The last time that the table was accessed. * @return Returns a reference to this object so that method calls can be chained together. */ public TableInput withLastAccessTime(java.util.Date lastAccessTime) { setLastAccessTime(lastAccessTime); return this; } /** *

* The last time that column statistics were computed for this table. *

* * @param lastAnalyzedTime * The last time that column statistics were computed for this table. */ public void setLastAnalyzedTime(java.util.Date lastAnalyzedTime) { this.lastAnalyzedTime = lastAnalyzedTime; } /** *

* The last time that column statistics were computed for this table. *

* * @return The last time that column statistics were computed for this table. */ public java.util.Date getLastAnalyzedTime() { return this.lastAnalyzedTime; } /** *

* The last time that column statistics were computed for this table. *

* * @param lastAnalyzedTime * The last time that column statistics were computed for this table. * @return Returns a reference to this object so that method calls can be chained together. */ public TableInput withLastAnalyzedTime(java.util.Date lastAnalyzedTime) { setLastAnalyzedTime(lastAnalyzedTime); return this; } /** *

* The retention time for this table. *

* * @param retention * The retention time for this table. */ public void setRetention(Integer retention) { this.retention = retention; } /** *

* The retention time for this table. *

* * @return The retention time for this table. */ public Integer getRetention() { return this.retention; } /** *

* The retention time for this table. *

* * @param retention * The retention time for this table. * @return Returns a reference to this object so that method calls can be chained together. */ public TableInput withRetention(Integer retention) { setRetention(retention); return this; } /** *

* A storage descriptor containing information about the physical storage of this table. *

* * @param storageDescriptor * A storage descriptor containing information about the physical storage of this table. */ public void setStorageDescriptor(StorageDescriptor storageDescriptor) { this.storageDescriptor = storageDescriptor; } /** *

* A storage descriptor containing information about the physical storage of this table. *

* * @return A storage descriptor containing information about the physical storage of this table. */ public StorageDescriptor getStorageDescriptor() { return this.storageDescriptor; } /** *

* A storage descriptor containing information about the physical storage of this table. *

* * @param storageDescriptor * A storage descriptor containing information about the physical storage of this table. * @return Returns a reference to this object so that method calls can be chained together. */ public TableInput withStorageDescriptor(StorageDescriptor storageDescriptor) { setStorageDescriptor(storageDescriptor); return this; } /** *

* A list of columns by which the table is partitioned. Only primitive types are supported as partition keys. *

*

* When you create a table used by Amazon Athena, and you do not specify any partitionKeys, you must at * least set the value of partitionKeys to an empty list. For example: *

*

* "PartitionKeys": [] *

* * @return A list of columns by which the table is partitioned. Only primitive types are supported as partition * keys.

*

* When you create a table used by Amazon Athena, and you do not specify any partitionKeys, you * must at least set the value of partitionKeys to an empty list. For example: *

*

* "PartitionKeys": [] */ public java.util.List getPartitionKeys() { return partitionKeys; } /** *

* A list of columns by which the table is partitioned. Only primitive types are supported as partition keys. *

*

* When you create a table used by Amazon Athena, and you do not specify any partitionKeys, you must at * least set the value of partitionKeys to an empty list. For example: *

*

* "PartitionKeys": [] *

* * @param partitionKeys * A list of columns by which the table is partitioned. Only primitive types are supported as partition * keys.

*

* When you create a table used by Amazon Athena, and you do not specify any partitionKeys, you * must at least set the value of partitionKeys to an empty list. For example: *

*

* "PartitionKeys": [] */ public void setPartitionKeys(java.util.Collection partitionKeys) { if (partitionKeys == null) { this.partitionKeys = null; return; } this.partitionKeys = new java.util.ArrayList(partitionKeys); } /** *

* A list of columns by which the table is partitioned. Only primitive types are supported as partition keys. *

*

* When you create a table used by Amazon Athena, and you do not specify any partitionKeys, you must at * least set the value of partitionKeys to an empty list. For example: *

*

* "PartitionKeys": [] *

*

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

* * @param partitionKeys * A list of columns by which the table is partitioned. Only primitive types are supported as partition * keys.

*

* When you create a table used by Amazon Athena, and you do not specify any partitionKeys, you * must at least set the value of partitionKeys to an empty list. For example: *

*

* "PartitionKeys": [] * @return Returns a reference to this object so that method calls can be chained together. */ public TableInput withPartitionKeys(Column... partitionKeys) { if (this.partitionKeys == null) { setPartitionKeys(new java.util.ArrayList(partitionKeys.length)); } for (Column ele : partitionKeys) { this.partitionKeys.add(ele); } return this; } /** *

* A list of columns by which the table is partitioned. Only primitive types are supported as partition keys. *

*

* When you create a table used by Amazon Athena, and you do not specify any partitionKeys, you must at * least set the value of partitionKeys to an empty list. For example: *

*

* "PartitionKeys": [] *

* * @param partitionKeys * A list of columns by which the table is partitioned. Only primitive types are supported as partition * keys.

*

* When you create a table used by Amazon Athena, and you do not specify any partitionKeys, you * must at least set the value of partitionKeys to an empty list. For example: *

*

* "PartitionKeys": [] * @return Returns a reference to this object so that method calls can be chained together. */ public TableInput withPartitionKeys(java.util.Collection partitionKeys) { setPartitionKeys(partitionKeys); return this; } /** *

* Included for Apache Hive compatibility. Not used in the normal course of Glue operations. If the table is a * VIRTUAL_VIEW, certain Athena configuration encoded in base64. *

* * @param viewOriginalText * Included for Apache Hive compatibility. Not used in the normal course of Glue operations. If the table is * a VIRTUAL_VIEW, certain Athena configuration encoded in base64. */ public void setViewOriginalText(String viewOriginalText) { this.viewOriginalText = viewOriginalText; } /** *

* Included for Apache Hive compatibility. Not used in the normal course of Glue operations. If the table is a * VIRTUAL_VIEW, certain Athena configuration encoded in base64. *

* * @return Included for Apache Hive compatibility. Not used in the normal course of Glue operations. If the table is * a VIRTUAL_VIEW, certain Athena configuration encoded in base64. */ public String getViewOriginalText() { return this.viewOriginalText; } /** *

* Included for Apache Hive compatibility. Not used in the normal course of Glue operations. If the table is a * VIRTUAL_VIEW, certain Athena configuration encoded in base64. *

* * @param viewOriginalText * Included for Apache Hive compatibility. Not used in the normal course of Glue operations. If the table is * a VIRTUAL_VIEW, certain Athena configuration encoded in base64. * @return Returns a reference to this object so that method calls can be chained together. */ public TableInput withViewOriginalText(String viewOriginalText) { setViewOriginalText(viewOriginalText); return this; } /** *

* Included for Apache Hive compatibility. Not used in the normal course of Glue operations. *

* * @param viewExpandedText * Included for Apache Hive compatibility. Not used in the normal course of Glue operations. */ public void setViewExpandedText(String viewExpandedText) { this.viewExpandedText = viewExpandedText; } /** *

* Included for Apache Hive compatibility. Not used in the normal course of Glue operations. *

* * @return Included for Apache Hive compatibility. Not used in the normal course of Glue operations. */ public String getViewExpandedText() { return this.viewExpandedText; } /** *

* Included for Apache Hive compatibility. Not used in the normal course of Glue operations. *

* * @param viewExpandedText * Included for Apache Hive compatibility. Not used in the normal course of Glue operations. * @return Returns a reference to this object so that method calls can be chained together. */ public TableInput withViewExpandedText(String viewExpandedText) { setViewExpandedText(viewExpandedText); return this; } /** *

* The type of this table. Glue will create tables with the EXTERNAL_TABLE type. Other services, such * as Athena, may create tables with additional table types. *

*

* Glue related table types: *

*
*
EXTERNAL_TABLE
*
*

* Hive compatible attribute - indicates a non-Hive managed table. *

*
*
GOVERNED
*
*

* Used by Lake Formation. The Glue Data Catalog understands GOVERNED. *

*
*
* * @param tableType * The type of this table. Glue will create tables with the EXTERNAL_TABLE type. Other services, * such as Athena, may create tables with additional table types.

*

* Glue related table types: *

*
*
EXTERNAL_TABLE
*
*

* Hive compatible attribute - indicates a non-Hive managed table. *

*
*
GOVERNED
*
*

* Used by Lake Formation. The Glue Data Catalog understands GOVERNED. *

*
*/ public void setTableType(String tableType) { this.tableType = tableType; } /** *

* The type of this table. Glue will create tables with the EXTERNAL_TABLE type. Other services, such * as Athena, may create tables with additional table types. *

*

* Glue related table types: *

*
*
EXTERNAL_TABLE
*
*

* Hive compatible attribute - indicates a non-Hive managed table. *

*
*
GOVERNED
*
*

* Used by Lake Formation. The Glue Data Catalog understands GOVERNED. *

*
*
* * @return The type of this table. Glue will create tables with the EXTERNAL_TABLE type. Other * services, such as Athena, may create tables with additional table types.

*

* Glue related table types: *

*
*
EXTERNAL_TABLE
*
*

* Hive compatible attribute - indicates a non-Hive managed table. *

*
*
GOVERNED
*
*

* Used by Lake Formation. The Glue Data Catalog understands GOVERNED. *

*
*/ public String getTableType() { return this.tableType; } /** *

* The type of this table. Glue will create tables with the EXTERNAL_TABLE type. Other services, such * as Athena, may create tables with additional table types. *

*

* Glue related table types: *

*
*
EXTERNAL_TABLE
*
*

* Hive compatible attribute - indicates a non-Hive managed table. *

*
*
GOVERNED
*
*

* Used by Lake Formation. The Glue Data Catalog understands GOVERNED. *

*
*
* * @param tableType * The type of this table. Glue will create tables with the EXTERNAL_TABLE type. Other services, * such as Athena, may create tables with additional table types.

*

* Glue related table types: *

*
*
EXTERNAL_TABLE
*
*

* Hive compatible attribute - indicates a non-Hive managed table. *

*
*
GOVERNED
*
*

* Used by Lake Formation. The Glue Data Catalog understands GOVERNED. *

*
* @return Returns a reference to this object so that method calls can be chained together. */ public TableInput withTableType(String tableType) { setTableType(tableType); return this; } /** *

* These key-value pairs define properties associated with the table. *

* * @return These key-value pairs define properties associated with the table. */ public java.util.Map getParameters() { return parameters; } /** *

* These key-value pairs define properties associated with the table. *

* * @param parameters * These key-value pairs define properties associated with the table. */ public void setParameters(java.util.Map parameters) { this.parameters = parameters; } /** *

* These key-value pairs define properties associated with the table. *

* * @param parameters * These key-value pairs define properties associated with the table. * @return Returns a reference to this object so that method calls can be chained together. */ public TableInput withParameters(java.util.Map parameters) { setParameters(parameters); return this; } /** * Add a single Parameters entry * * @see TableInput#withParameters * @returns a reference to this object so that method calls can be chained together. */ public TableInput addParametersEntry(String key, String value) { if (null == this.parameters) { this.parameters = new java.util.HashMap(); } if (this.parameters.containsKey(key)) throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided."); this.parameters.put(key, value); return this; } /** * Removes all the entries added into Parameters. * * @return Returns a reference to this object so that method calls can be chained together. */ public TableInput clearParametersEntries() { this.parameters = null; return this; } /** *

* A TableIdentifier structure that describes a target table for resource linking. *

* * @param targetTable * A TableIdentifier structure that describes a target table for resource linking. */ public void setTargetTable(TableIdentifier targetTable) { this.targetTable = targetTable; } /** *

* A TableIdentifier structure that describes a target table for resource linking. *

* * @return A TableIdentifier structure that describes a target table for resource linking. */ public TableIdentifier getTargetTable() { return this.targetTable; } /** *

* A TableIdentifier structure that describes a target table for resource linking. *

* * @param targetTable * A TableIdentifier structure that describes a target table for resource linking. * @return Returns a reference to this object so that method calls can be chained together. */ public TableInput withTargetTable(TableIdentifier targetTable) { setTargetTable(targetTable); 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 (getName() != null) sb.append("Name: ").append(getName()).append(","); if (getDescription() != null) sb.append("Description: ").append(getDescription()).append(","); if (getOwner() != null) sb.append("Owner: ").append(getOwner()).append(","); if (getLastAccessTime() != null) sb.append("LastAccessTime: ").append(getLastAccessTime()).append(","); if (getLastAnalyzedTime() != null) sb.append("LastAnalyzedTime: ").append(getLastAnalyzedTime()).append(","); if (getRetention() != null) sb.append("Retention: ").append(getRetention()).append(","); if (getStorageDescriptor() != null) sb.append("StorageDescriptor: ").append(getStorageDescriptor()).append(","); if (getPartitionKeys() != null) sb.append("PartitionKeys: ").append(getPartitionKeys()).append(","); if (getViewOriginalText() != null) sb.append("ViewOriginalText: ").append(getViewOriginalText()).append(","); if (getViewExpandedText() != null) sb.append("ViewExpandedText: ").append(getViewExpandedText()).append(","); if (getTableType() != null) sb.append("TableType: ").append(getTableType()).append(","); if (getParameters() != null) sb.append("Parameters: ").append(getParameters()).append(","); if (getTargetTable() != null) sb.append("TargetTable: ").append(getTargetTable()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof TableInput == false) return false; TableInput other = (TableInput) obj; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getDescription() == null ^ this.getDescription() == null) return false; if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == false) return false; if (other.getOwner() == null ^ this.getOwner() == null) return false; if (other.getOwner() != null && other.getOwner().equals(this.getOwner()) == false) return false; if (other.getLastAccessTime() == null ^ this.getLastAccessTime() == null) return false; if (other.getLastAccessTime() != null && other.getLastAccessTime().equals(this.getLastAccessTime()) == false) return false; if (other.getLastAnalyzedTime() == null ^ this.getLastAnalyzedTime() == null) return false; if (other.getLastAnalyzedTime() != null && other.getLastAnalyzedTime().equals(this.getLastAnalyzedTime()) == false) return false; if (other.getRetention() == null ^ this.getRetention() == null) return false; if (other.getRetention() != null && other.getRetention().equals(this.getRetention()) == false) return false; if (other.getStorageDescriptor() == null ^ this.getStorageDescriptor() == null) return false; if (other.getStorageDescriptor() != null && other.getStorageDescriptor().equals(this.getStorageDescriptor()) == false) return false; if (other.getPartitionKeys() == null ^ this.getPartitionKeys() == null) return false; if (other.getPartitionKeys() != null && other.getPartitionKeys().equals(this.getPartitionKeys()) == false) return false; if (other.getViewOriginalText() == null ^ this.getViewOriginalText() == null) return false; if (other.getViewOriginalText() != null && other.getViewOriginalText().equals(this.getViewOriginalText()) == false) return false; if (other.getViewExpandedText() == null ^ this.getViewExpandedText() == null) return false; if (other.getViewExpandedText() != null && other.getViewExpandedText().equals(this.getViewExpandedText()) == false) return false; if (other.getTableType() == null ^ this.getTableType() == null) return false; if (other.getTableType() != null && other.getTableType().equals(this.getTableType()) == false) return false; if (other.getParameters() == null ^ this.getParameters() == null) return false; if (other.getParameters() != null && other.getParameters().equals(this.getParameters()) == false) return false; if (other.getTargetTable() == null ^ this.getTargetTable() == null) return false; if (other.getTargetTable() != null && other.getTargetTable().equals(this.getTargetTable()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode()); hashCode = prime * hashCode + ((getOwner() == null) ? 0 : getOwner().hashCode()); hashCode = prime * hashCode + ((getLastAccessTime() == null) ? 0 : getLastAccessTime().hashCode()); hashCode = prime * hashCode + ((getLastAnalyzedTime() == null) ? 0 : getLastAnalyzedTime().hashCode()); hashCode = prime * hashCode + ((getRetention() == null) ? 0 : getRetention().hashCode()); hashCode = prime * hashCode + ((getStorageDescriptor() == null) ? 0 : getStorageDescriptor().hashCode()); hashCode = prime * hashCode + ((getPartitionKeys() == null) ? 0 : getPartitionKeys().hashCode()); hashCode = prime * hashCode + ((getViewOriginalText() == null) ? 0 : getViewOriginalText().hashCode()); hashCode = prime * hashCode + ((getViewExpandedText() == null) ? 0 : getViewExpandedText().hashCode()); hashCode = prime * hashCode + ((getTableType() == null) ? 0 : getTableType().hashCode()); hashCode = prime * hashCode + ((getParameters() == null) ? 0 : getParameters().hashCode()); hashCode = prime * hashCode + ((getTargetTable() == null) ? 0 : getTargetTable().hashCode()); return hashCode; } @Override public TableInput clone() { try { return (TableInput) 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.glue.model.transform.TableInputMarshaller.getInstance().marshall(this, protocolMarshaller); } }