/* * 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; /** *

* Specifies a data target that writes to Amazon S3 in Apache Parquet columnar storage. *

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

* The name of the data target. *

*/ private String name; /** *

* The nodes that are inputs to the data target. *

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

* Specifies native partitioning using a sequence of keys. *

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

* A single Amazon S3 path to write to. *

*/ private String path; /** *

* Specifies how the data is compressed. This is generally not necessary if the data has a standard file extension. * Possible values are "gzip" and "bzip"). *

*/ private String compression; /** *

* A policy that specifies update behavior for the crawler. *

*/ private DirectSchemaChangePolicy schemaChangePolicy; /** *

* The name of the data target. *

* * @param name * The name of the data target. */ public void setName(String name) { this.name = name; } /** *

* The name of the data target. *

* * @return The name of the data target. */ public String getName() { return this.name; } /** *

* The name of the data target. *

* * @param name * The name of the data target. * @return Returns a reference to this object so that method calls can be chained together. */ public S3GlueParquetTarget withName(String name) { setName(name); return this; } /** *

* The nodes that are inputs to the data target. *

* * @return The nodes that are inputs to the data target. */ public java.util.List getInputs() { return inputs; } /** *

* The nodes that are inputs to the data target. *

* * @param inputs * The nodes that are inputs to the data target. */ public void setInputs(java.util.Collection inputs) { if (inputs == null) { this.inputs = null; return; } this.inputs = new java.util.ArrayList(inputs); } /** *

* The nodes that are inputs to the data target. *

*

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

* * @param inputs * The nodes that are inputs to the data target. * @return Returns a reference to this object so that method calls can be chained together. */ public S3GlueParquetTarget withInputs(String... inputs) { if (this.inputs == null) { setInputs(new java.util.ArrayList(inputs.length)); } for (String ele : inputs) { this.inputs.add(ele); } return this; } /** *

* The nodes that are inputs to the data target. *

* * @param inputs * The nodes that are inputs to the data target. * @return Returns a reference to this object so that method calls can be chained together. */ public S3GlueParquetTarget withInputs(java.util.Collection inputs) { setInputs(inputs); return this; } /** *

* Specifies native partitioning using a sequence of keys. *

* * @return Specifies native partitioning using a sequence of keys. */ public java.util.List> getPartitionKeys() { return partitionKeys; } /** *

* Specifies native partitioning using a sequence of keys. *

* * @param partitionKeys * Specifies native partitioning using a sequence of keys. */ public void setPartitionKeys(java.util.Collection> partitionKeys) { if (partitionKeys == null) { this.partitionKeys = null; return; } this.partitionKeys = new java.util.ArrayList>(partitionKeys); } /** *

* Specifies native partitioning using a sequence of keys. *

*

* 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 * Specifies native partitioning using a sequence of keys. * @return Returns a reference to this object so that method calls can be chained together. */ public S3GlueParquetTarget withPartitionKeys(java.util.List... partitionKeys) { if (this.partitionKeys == null) { setPartitionKeys(new java.util.ArrayList>(partitionKeys.length)); } for (java.util.List ele : partitionKeys) { this.partitionKeys.add(ele); } return this; } /** *

* Specifies native partitioning using a sequence of keys. *

* * @param partitionKeys * Specifies native partitioning using a sequence of keys. * @return Returns a reference to this object so that method calls can be chained together. */ public S3GlueParquetTarget withPartitionKeys(java.util.Collection> partitionKeys) { setPartitionKeys(partitionKeys); return this; } /** *

* A single Amazon S3 path to write to. *

* * @param path * A single Amazon S3 path to write to. */ public void setPath(String path) { this.path = path; } /** *

* A single Amazon S3 path to write to. *

* * @return A single Amazon S3 path to write to. */ public String getPath() { return this.path; } /** *

* A single Amazon S3 path to write to. *

* * @param path * A single Amazon S3 path to write to. * @return Returns a reference to this object so that method calls can be chained together. */ public S3GlueParquetTarget withPath(String path) { setPath(path); return this; } /** *

* Specifies how the data is compressed. This is generally not necessary if the data has a standard file extension. * Possible values are "gzip" and "bzip"). *

* * @param compression * Specifies how the data is compressed. This is generally not necessary if the data has a standard file * extension. Possible values are "gzip" and "bzip"). * @see ParquetCompressionType */ public void setCompression(String compression) { this.compression = compression; } /** *

* Specifies how the data is compressed. This is generally not necessary if the data has a standard file extension. * Possible values are "gzip" and "bzip"). *

* * @return Specifies how the data is compressed. This is generally not necessary if the data has a standard file * extension. Possible values are "gzip" and "bzip"). * @see ParquetCompressionType */ public String getCompression() { return this.compression; } /** *

* Specifies how the data is compressed. This is generally not necessary if the data has a standard file extension. * Possible values are "gzip" and "bzip"). *

* * @param compression * Specifies how the data is compressed. This is generally not necessary if the data has a standard file * extension. Possible values are "gzip" and "bzip"). * @return Returns a reference to this object so that method calls can be chained together. * @see ParquetCompressionType */ public S3GlueParquetTarget withCompression(String compression) { setCompression(compression); return this; } /** *

* Specifies how the data is compressed. This is generally not necessary if the data has a standard file extension. * Possible values are "gzip" and "bzip"). *

* * @param compression * Specifies how the data is compressed. This is generally not necessary if the data has a standard file * extension. Possible values are "gzip" and "bzip"). * @return Returns a reference to this object so that method calls can be chained together. * @see ParquetCompressionType */ public S3GlueParquetTarget withCompression(ParquetCompressionType compression) { this.compression = compression.toString(); return this; } /** *

* A policy that specifies update behavior for the crawler. *

* * @param schemaChangePolicy * A policy that specifies update behavior for the crawler. */ public void setSchemaChangePolicy(DirectSchemaChangePolicy schemaChangePolicy) { this.schemaChangePolicy = schemaChangePolicy; } /** *

* A policy that specifies update behavior for the crawler. *

* * @return A policy that specifies update behavior for the crawler. */ public DirectSchemaChangePolicy getSchemaChangePolicy() { return this.schemaChangePolicy; } /** *

* A policy that specifies update behavior for the crawler. *

* * @param schemaChangePolicy * A policy that specifies update behavior for the crawler. * @return Returns a reference to this object so that method calls can be chained together. */ public S3GlueParquetTarget withSchemaChangePolicy(DirectSchemaChangePolicy schemaChangePolicy) { setSchemaChangePolicy(schemaChangePolicy); 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 (getInputs() != null) sb.append("Inputs: ").append(getInputs()).append(","); if (getPartitionKeys() != null) sb.append("PartitionKeys: ").append(getPartitionKeys()).append(","); if (getPath() != null) sb.append("Path: ").append(getPath()).append(","); if (getCompression() != null) sb.append("Compression: ").append(getCompression()).append(","); if (getSchemaChangePolicy() != null) sb.append("SchemaChangePolicy: ").append(getSchemaChangePolicy()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof S3GlueParquetTarget == false) return false; S3GlueParquetTarget other = (S3GlueParquetTarget) obj; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getInputs() == null ^ this.getInputs() == null) return false; if (other.getInputs() != null && other.getInputs().equals(this.getInputs()) == 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.getPath() == null ^ this.getPath() == null) return false; if (other.getPath() != null && other.getPath().equals(this.getPath()) == false) return false; if (other.getCompression() == null ^ this.getCompression() == null) return false; if (other.getCompression() != null && other.getCompression().equals(this.getCompression()) == false) return false; if (other.getSchemaChangePolicy() == null ^ this.getSchemaChangePolicy() == null) return false; if (other.getSchemaChangePolicy() != null && other.getSchemaChangePolicy().equals(this.getSchemaChangePolicy()) == 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 + ((getInputs() == null) ? 0 : getInputs().hashCode()); hashCode = prime * hashCode + ((getPartitionKeys() == null) ? 0 : getPartitionKeys().hashCode()); hashCode = prime * hashCode + ((getPath() == null) ? 0 : getPath().hashCode()); hashCode = prime * hashCode + ((getCompression() == null) ? 0 : getCompression().hashCode()); hashCode = prime * hashCode + ((getSchemaChangePolicy() == null) ? 0 : getSchemaChangePolicy().hashCode()); return hashCode; } @Override public S3GlueParquetTarget clone() { try { return (S3GlueParquetTarget) 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.S3GlueParquetTargetMarshaller.getInstance().marshall(this, protocolMarshaller); } }