/* * 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. *
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class S3DirectTarget 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* Specifies native partitioning using a sequence of keys. *
*/ private java.util.List* 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"
).
*
* Specifies the data output format for the target. *
*/ private String format; /** ** 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 S3DirectTarget 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* 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* 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 S3DirectTarget withInputs(String... inputs) { if (this.inputs == null) { setInputs(new java.util.ArrayList* 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 S3DirectTarget withInputs(java.util.Collection* Specifies native partitioning using a sequence of keys. *
* * @return Specifies native partitioning using a sequence of keys. */ public java.util.List* Specifies native partitioning using a sequence of keys. *
* * @param partitionKeys * Specifies native partitioning using a sequence of keys. */ public void setPartitionKeys(java.util.Collection* 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 S3DirectTarget withPartitionKeys(java.util.List* 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 S3DirectTarget withPartitionKeys(java.util.Collection* 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 S3DirectTarget 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"
).
*
"gzip"
and "bzip"
).
*/
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"
).
*
"gzip"
and "bzip"
).
*/
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"
).
*
"gzip"
and "bzip"
).
* @return Returns a reference to this object so that method calls can be chained together.
*/
public S3DirectTarget withCompression(String compression) {
setCompression(compression);
return this;
}
/**
* * Specifies the data output format for the target. *
* * @param format * Specifies the data output format for the target. * @see TargetFormat */ public void setFormat(String format) { this.format = format; } /** ** Specifies the data output format for the target. *
* * @return Specifies the data output format for the target. * @see TargetFormat */ public String getFormat() { return this.format; } /** ** Specifies the data output format for the target. *
* * @param format * Specifies the data output format for the target. * @return Returns a reference to this object so that method calls can be chained together. * @see TargetFormat */ public S3DirectTarget withFormat(String format) { setFormat(format); return this; } /** ** Specifies the data output format for the target. *
* * @param format * Specifies the data output format for the target. * @return Returns a reference to this object so that method calls can be chained together. * @see TargetFormat */ public S3DirectTarget withFormat(TargetFormat format) { this.format = format.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 S3DirectTarget 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 (getFormat() != null) sb.append("Format: ").append(getFormat()).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 S3DirectTarget == false) return false; S3DirectTarget other = (S3DirectTarget) 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.getFormat() == null ^ this.getFormat() == null) return false; if (other.getFormat() != null && other.getFormat().equals(this.getFormat()) == 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 + ((getFormat() == null) ? 0 : getFormat().hashCode()); hashCode = prime * hashCode + ((getSchemaChangePolicy() == null) ? 0 : getSchemaChangePolicy().hashCode()); return hashCode; } @Override public S3DirectTarget clone() { try { return (S3DirectTarget) 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.S3DirectTargetMarshaller.getInstance().marshall(this, protocolMarshaller); } }