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

* The structure used to create and update a partition. *

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

* The values of the partition. Although this parameter is not required by the SDK, you must specify this parameter * for a valid input. *

*

* The values for the keys for the new partition must be passed as an array of String objects that must be ordered * in the same order as the partition keys appearing in the Amazon S3 prefix. Otherwise Glue will add the values to * the wrong keys. *

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

* The last time at which the partition was accessed. *

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

* Provides information about the physical location where the partition is stored. *

*/ private StorageDescriptor storageDescriptor; /** *

* These key-value pairs define partition parameters. *

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

* The last time at which column statistics were computed for this partition. *

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

* The values of the partition. Although this parameter is not required by the SDK, you must specify this parameter * for a valid input. *

*

* The values for the keys for the new partition must be passed as an array of String objects that must be ordered * in the same order as the partition keys appearing in the Amazon S3 prefix. Otherwise Glue will add the values to * the wrong keys. *

* * @return The values of the partition. Although this parameter is not required by the SDK, you must specify this * parameter for a valid input.

*

* The values for the keys for the new partition must be passed as an array of String objects that must be * ordered in the same order as the partition keys appearing in the Amazon S3 prefix. Otherwise Glue will * add the values to the wrong keys. */ public java.util.List getValues() { return values; } /** *

* The values of the partition. Although this parameter is not required by the SDK, you must specify this parameter * for a valid input. *

*

* The values for the keys for the new partition must be passed as an array of String objects that must be ordered * in the same order as the partition keys appearing in the Amazon S3 prefix. Otherwise Glue will add the values to * the wrong keys. *

* * @param values * The values of the partition. Although this parameter is not required by the SDK, you must specify this * parameter for a valid input.

*

* The values for the keys for the new partition must be passed as an array of String objects that must be * ordered in the same order as the partition keys appearing in the Amazon S3 prefix. Otherwise Glue will add * the values to the wrong keys. */ public void setValues(java.util.Collection values) { if (values == null) { this.values = null; return; } this.values = new java.util.ArrayList(values); } /** *

* The values of the partition. Although this parameter is not required by the SDK, you must specify this parameter * for a valid input. *

*

* The values for the keys for the new partition must be passed as an array of String objects that must be ordered * in the same order as the partition keys appearing in the Amazon S3 prefix. Otherwise Glue will add the values to * the wrong keys. *

*

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

* * @param values * The values of the partition. Although this parameter is not required by the SDK, you must specify this * parameter for a valid input.

*

* The values for the keys for the new partition must be passed as an array of String objects that must be * ordered in the same order as the partition keys appearing in the Amazon S3 prefix. Otherwise Glue will add * the values to the wrong keys. * @return Returns a reference to this object so that method calls can be chained together. */ public PartitionInput withValues(String... values) { if (this.values == null) { setValues(new java.util.ArrayList(values.length)); } for (String ele : values) { this.values.add(ele); } return this; } /** *

* The values of the partition. Although this parameter is not required by the SDK, you must specify this parameter * for a valid input. *

*

* The values for the keys for the new partition must be passed as an array of String objects that must be ordered * in the same order as the partition keys appearing in the Amazon S3 prefix. Otherwise Glue will add the values to * the wrong keys. *

* * @param values * The values of the partition. Although this parameter is not required by the SDK, you must specify this * parameter for a valid input.

*

* The values for the keys for the new partition must be passed as an array of String objects that must be * ordered in the same order as the partition keys appearing in the Amazon S3 prefix. Otherwise Glue will add * the values to the wrong keys. * @return Returns a reference to this object so that method calls can be chained together. */ public PartitionInput withValues(java.util.Collection values) { setValues(values); return this; } /** *

* The last time at which the partition was accessed. *

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

* The last time at which the partition was accessed. *

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

* The last time at which the partition was accessed. *

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

* Provides information about the physical location where the partition is stored. *

* * @param storageDescriptor * Provides information about the physical location where the partition is stored. */ public void setStorageDescriptor(StorageDescriptor storageDescriptor) { this.storageDescriptor = storageDescriptor; } /** *

* Provides information about the physical location where the partition is stored. *

* * @return Provides information about the physical location where the partition is stored. */ public StorageDescriptor getStorageDescriptor() { return this.storageDescriptor; } /** *

* Provides information about the physical location where the partition is stored. *

* * @param storageDescriptor * Provides information about the physical location where the partition is stored. * @return Returns a reference to this object so that method calls can be chained together. */ public PartitionInput withStorageDescriptor(StorageDescriptor storageDescriptor) { setStorageDescriptor(storageDescriptor); return this; } /** *

* These key-value pairs define partition parameters. *

* * @return These key-value pairs define partition parameters. */ public java.util.Map getParameters() { return parameters; } /** *

* These key-value pairs define partition parameters. *

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

* These key-value pairs define partition parameters. *

* * @param parameters * These key-value pairs define partition parameters. * @return Returns a reference to this object so that method calls can be chained together. */ public PartitionInput withParameters(java.util.Map parameters) { setParameters(parameters); return this; } /** * Add a single Parameters entry * * @see PartitionInput#withParameters * @returns a reference to this object so that method calls can be chained together. */ public PartitionInput 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 PartitionInput clearParametersEntries() { this.parameters = null; return this; } /** *

* The last time at which column statistics were computed for this partition. *

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

* The last time at which column statistics were computed for this partition. *

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

* The last time at which column statistics were computed for this partition. *

* * @param lastAnalyzedTime * The last time at which column statistics were computed for this partition. * @return Returns a reference to this object so that method calls can be chained together. */ public PartitionInput withLastAnalyzedTime(java.util.Date lastAnalyzedTime) { setLastAnalyzedTime(lastAnalyzedTime); 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 (getValues() != null) sb.append("Values: ").append(getValues()).append(","); if (getLastAccessTime() != null) sb.append("LastAccessTime: ").append(getLastAccessTime()).append(","); if (getStorageDescriptor() != null) sb.append("StorageDescriptor: ").append(getStorageDescriptor()).append(","); if (getParameters() != null) sb.append("Parameters: ").append(getParameters()).append(","); if (getLastAnalyzedTime() != null) sb.append("LastAnalyzedTime: ").append(getLastAnalyzedTime()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof PartitionInput == false) return false; PartitionInput other = (PartitionInput) obj; if (other.getValues() == null ^ this.getValues() == null) return false; if (other.getValues() != null && other.getValues().equals(this.getValues()) == 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.getStorageDescriptor() == null ^ this.getStorageDescriptor() == null) return false; if (other.getStorageDescriptor() != null && other.getStorageDescriptor().equals(this.getStorageDescriptor()) == 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.getLastAnalyzedTime() == null ^ this.getLastAnalyzedTime() == null) return false; if (other.getLastAnalyzedTime() != null && other.getLastAnalyzedTime().equals(this.getLastAnalyzedTime()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getValues() == null) ? 0 : getValues().hashCode()); hashCode = prime * hashCode + ((getLastAccessTime() == null) ? 0 : getLastAccessTime().hashCode()); hashCode = prime * hashCode + ((getStorageDescriptor() == null) ? 0 : getStorageDescriptor().hashCode()); hashCode = prime * hashCode + ((getParameters() == null) ? 0 : getParameters().hashCode()); hashCode = prime * hashCode + ((getLastAnalyzedTime() == null) ? 0 : getLastAnalyzedTime().hashCode()); return hashCode; } @Override public PartitionInput clone() { try { return (PartitionInput) 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.PartitionInputMarshaller.getInstance().marshall(this, protocolMarshaller); } }