/* * 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.rdsdata.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *

* Contains the metadata for a column. *

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

* The name of the column. *

*/ private String name; /** *

* The type of the column. *

*/ private Integer type; /** *

* The database-specific data type of the column. *

*/ private String typeName; /** *

* The label for the column. *

*/ private String label; /** *

* The name of the schema that owns the table that includes the column. *

*/ private String schemaName; /** *

* The name of the table that includes the column. *

*/ private String tableName; /** *

* A value that indicates whether the column increments automatically. *

*/ private Boolean isAutoIncrement; /** *

* A value that indicates whether an integer column is signed. *

*/ private Boolean isSigned; /** *

* A value that indicates whether the column contains currency values. *

*/ private Boolean isCurrency; /** *

* A value that indicates whether the column is case-sensitive. *

*/ private Boolean isCaseSensitive; /** *

* A value that indicates whether the column is nullable. *

*/ private Integer nullable; /** *

* The precision value of a decimal number column. *

*/ private Integer precision; /** *

* The scale value of a decimal number column. *

*/ private Integer scale; /** *

* The type of the column. *

*/ private Integer arrayBaseColumnType; /** *

* The name of the column. *

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

* The name of the column. *

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

* The name of the column. *

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

* The type of the column. *

* * @param type * The type of the column. */ public void setType(Integer type) { this.type = type; } /** *

* The type of the column. *

* * @return The type of the column. */ public Integer getType() { return this.type; } /** *

* The type of the column. *

* * @param type * The type of the column. * @return Returns a reference to this object so that method calls can be chained together. */ public ColumnMetadata withType(Integer type) { setType(type); return this; } /** *

* The database-specific data type of the column. *

* * @param typeName * The database-specific data type of the column. */ public void setTypeName(String typeName) { this.typeName = typeName; } /** *

* The database-specific data type of the column. *

* * @return The database-specific data type of the column. */ public String getTypeName() { return this.typeName; } /** *

* The database-specific data type of the column. *

* * @param typeName * The database-specific data type of the column. * @return Returns a reference to this object so that method calls can be chained together. */ public ColumnMetadata withTypeName(String typeName) { setTypeName(typeName); return this; } /** *

* The label for the column. *

* * @param label * The label for the column. */ public void setLabel(String label) { this.label = label; } /** *

* The label for the column. *

* * @return The label for the column. */ public String getLabel() { return this.label; } /** *

* The label for the column. *

* * @param label * The label for the column. * @return Returns a reference to this object so that method calls can be chained together. */ public ColumnMetadata withLabel(String label) { setLabel(label); return this; } /** *

* The name of the schema that owns the table that includes the column. *

* * @param schemaName * The name of the schema that owns the table that includes the column. */ public void setSchemaName(String schemaName) { this.schemaName = schemaName; } /** *

* The name of the schema that owns the table that includes the column. *

* * @return The name of the schema that owns the table that includes the column. */ public String getSchemaName() { return this.schemaName; } /** *

* The name of the schema that owns the table that includes the column. *

* * @param schemaName * The name of the schema that owns the table that includes the column. * @return Returns a reference to this object so that method calls can be chained together. */ public ColumnMetadata withSchemaName(String schemaName) { setSchemaName(schemaName); return this; } /** *

* The name of the table that includes the column. *

* * @param tableName * The name of the table that includes the column. */ public void setTableName(String tableName) { this.tableName = tableName; } /** *

* The name of the table that includes the column. *

* * @return The name of the table that includes the column. */ public String getTableName() { return this.tableName; } /** *

* The name of the table that includes the column. *

* * @param tableName * The name of the table that includes the column. * @return Returns a reference to this object so that method calls can be chained together. */ public ColumnMetadata withTableName(String tableName) { setTableName(tableName); return this; } /** *

* A value that indicates whether the column increments automatically. *

* * @param isAutoIncrement * A value that indicates whether the column increments automatically. */ public void setIsAutoIncrement(Boolean isAutoIncrement) { this.isAutoIncrement = isAutoIncrement; } /** *

* A value that indicates whether the column increments automatically. *

* * @return A value that indicates whether the column increments automatically. */ public Boolean getIsAutoIncrement() { return this.isAutoIncrement; } /** *

* A value that indicates whether the column increments automatically. *

* * @param isAutoIncrement * A value that indicates whether the column increments automatically. * @return Returns a reference to this object so that method calls can be chained together. */ public ColumnMetadata withIsAutoIncrement(Boolean isAutoIncrement) { setIsAutoIncrement(isAutoIncrement); return this; } /** *

* A value that indicates whether the column increments automatically. *

* * @return A value that indicates whether the column increments automatically. */ public Boolean isAutoIncrement() { return this.isAutoIncrement; } /** *

* A value that indicates whether an integer column is signed. *

* * @param isSigned * A value that indicates whether an integer column is signed. */ public void setIsSigned(Boolean isSigned) { this.isSigned = isSigned; } /** *

* A value that indicates whether an integer column is signed. *

* * @return A value that indicates whether an integer column is signed. */ public Boolean getIsSigned() { return this.isSigned; } /** *

* A value that indicates whether an integer column is signed. *

* * @param isSigned * A value that indicates whether an integer column is signed. * @return Returns a reference to this object so that method calls can be chained together. */ public ColumnMetadata withIsSigned(Boolean isSigned) { setIsSigned(isSigned); return this; } /** *

* A value that indicates whether an integer column is signed. *

* * @return A value that indicates whether an integer column is signed. */ public Boolean isSigned() { return this.isSigned; } /** *

* A value that indicates whether the column contains currency values. *

* * @param isCurrency * A value that indicates whether the column contains currency values. */ public void setIsCurrency(Boolean isCurrency) { this.isCurrency = isCurrency; } /** *

* A value that indicates whether the column contains currency values. *

* * @return A value that indicates whether the column contains currency values. */ public Boolean getIsCurrency() { return this.isCurrency; } /** *

* A value that indicates whether the column contains currency values. *

* * @param isCurrency * A value that indicates whether the column contains currency values. * @return Returns a reference to this object so that method calls can be chained together. */ public ColumnMetadata withIsCurrency(Boolean isCurrency) { setIsCurrency(isCurrency); return this; } /** *

* A value that indicates whether the column contains currency values. *

* * @return A value that indicates whether the column contains currency values. */ public Boolean isCurrency() { return this.isCurrency; } /** *

* A value that indicates whether the column is case-sensitive. *

* * @param isCaseSensitive * A value that indicates whether the column is case-sensitive. */ public void setIsCaseSensitive(Boolean isCaseSensitive) { this.isCaseSensitive = isCaseSensitive; } /** *

* A value that indicates whether the column is case-sensitive. *

* * @return A value that indicates whether the column is case-sensitive. */ public Boolean getIsCaseSensitive() { return this.isCaseSensitive; } /** *

* A value that indicates whether the column is case-sensitive. *

* * @param isCaseSensitive * A value that indicates whether the column is case-sensitive. * @return Returns a reference to this object so that method calls can be chained together. */ public ColumnMetadata withIsCaseSensitive(Boolean isCaseSensitive) { setIsCaseSensitive(isCaseSensitive); return this; } /** *

* A value that indicates whether the column is case-sensitive. *

* * @return A value that indicates whether the column is case-sensitive. */ public Boolean isCaseSensitive() { return this.isCaseSensitive; } /** *

* A value that indicates whether the column is nullable. *

* * @param nullable * A value that indicates whether the column is nullable. */ public void setNullable(Integer nullable) { this.nullable = nullable; } /** *

* A value that indicates whether the column is nullable. *

* * @return A value that indicates whether the column is nullable. */ public Integer getNullable() { return this.nullable; } /** *

* A value that indicates whether the column is nullable. *

* * @param nullable * A value that indicates whether the column is nullable. * @return Returns a reference to this object so that method calls can be chained together. */ public ColumnMetadata withNullable(Integer nullable) { setNullable(nullable); return this; } /** *

* The precision value of a decimal number column. *

* * @param precision * The precision value of a decimal number column. */ public void setPrecision(Integer precision) { this.precision = precision; } /** *

* The precision value of a decimal number column. *

* * @return The precision value of a decimal number column. */ public Integer getPrecision() { return this.precision; } /** *

* The precision value of a decimal number column. *

* * @param precision * The precision value of a decimal number column. * @return Returns a reference to this object so that method calls can be chained together. */ public ColumnMetadata withPrecision(Integer precision) { setPrecision(precision); return this; } /** *

* The scale value of a decimal number column. *

* * @param scale * The scale value of a decimal number column. */ public void setScale(Integer scale) { this.scale = scale; } /** *

* The scale value of a decimal number column. *

* * @return The scale value of a decimal number column. */ public Integer getScale() { return this.scale; } /** *

* The scale value of a decimal number column. *

* * @param scale * The scale value of a decimal number column. * @return Returns a reference to this object so that method calls can be chained together. */ public ColumnMetadata withScale(Integer scale) { setScale(scale); return this; } /** *

* The type of the column. *

* * @param arrayBaseColumnType * The type of the column. */ public void setArrayBaseColumnType(Integer arrayBaseColumnType) { this.arrayBaseColumnType = arrayBaseColumnType; } /** *

* The type of the column. *

* * @return The type of the column. */ public Integer getArrayBaseColumnType() { return this.arrayBaseColumnType; } /** *

* The type of the column. *

* * @param arrayBaseColumnType * The type of the column. * @return Returns a reference to this object so that method calls can be chained together. */ public ColumnMetadata withArrayBaseColumnType(Integer arrayBaseColumnType) { setArrayBaseColumnType(arrayBaseColumnType); 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 (getType() != null) sb.append("Type: ").append(getType()).append(","); if (getTypeName() != null) sb.append("TypeName: ").append(getTypeName()).append(","); if (getLabel() != null) sb.append("Label: ").append(getLabel()).append(","); if (getSchemaName() != null) sb.append("SchemaName: ").append(getSchemaName()).append(","); if (getTableName() != null) sb.append("TableName: ").append(getTableName()).append(","); if (getIsAutoIncrement() != null) sb.append("IsAutoIncrement: ").append(getIsAutoIncrement()).append(","); if (getIsSigned() != null) sb.append("IsSigned: ").append(getIsSigned()).append(","); if (getIsCurrency() != null) sb.append("IsCurrency: ").append(getIsCurrency()).append(","); if (getIsCaseSensitive() != null) sb.append("IsCaseSensitive: ").append(getIsCaseSensitive()).append(","); if (getNullable() != null) sb.append("Nullable: ").append(getNullable()).append(","); if (getPrecision() != null) sb.append("Precision: ").append(getPrecision()).append(","); if (getScale() != null) sb.append("Scale: ").append(getScale()).append(","); if (getArrayBaseColumnType() != null) sb.append("ArrayBaseColumnType: ").append(getArrayBaseColumnType()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ColumnMetadata == false) return false; ColumnMetadata other = (ColumnMetadata) obj; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getType() == null ^ this.getType() == null) return false; if (other.getType() != null && other.getType().equals(this.getType()) == false) return false; if (other.getTypeName() == null ^ this.getTypeName() == null) return false; if (other.getTypeName() != null && other.getTypeName().equals(this.getTypeName()) == false) return false; if (other.getLabel() == null ^ this.getLabel() == null) return false; if (other.getLabel() != null && other.getLabel().equals(this.getLabel()) == false) return false; if (other.getSchemaName() == null ^ this.getSchemaName() == null) return false; if (other.getSchemaName() != null && other.getSchemaName().equals(this.getSchemaName()) == false) return false; if (other.getTableName() == null ^ this.getTableName() == null) return false; if (other.getTableName() != null && other.getTableName().equals(this.getTableName()) == false) return false; if (other.getIsAutoIncrement() == null ^ this.getIsAutoIncrement() == null) return false; if (other.getIsAutoIncrement() != null && other.getIsAutoIncrement().equals(this.getIsAutoIncrement()) == false) return false; if (other.getIsSigned() == null ^ this.getIsSigned() == null) return false; if (other.getIsSigned() != null && other.getIsSigned().equals(this.getIsSigned()) == false) return false; if (other.getIsCurrency() == null ^ this.getIsCurrency() == null) return false; if (other.getIsCurrency() != null && other.getIsCurrency().equals(this.getIsCurrency()) == false) return false; if (other.getIsCaseSensitive() == null ^ this.getIsCaseSensitive() == null) return false; if (other.getIsCaseSensitive() != null && other.getIsCaseSensitive().equals(this.getIsCaseSensitive()) == false) return false; if (other.getNullable() == null ^ this.getNullable() == null) return false; if (other.getNullable() != null && other.getNullable().equals(this.getNullable()) == false) return false; if (other.getPrecision() == null ^ this.getPrecision() == null) return false; if (other.getPrecision() != null && other.getPrecision().equals(this.getPrecision()) == false) return false; if (other.getScale() == null ^ this.getScale() == null) return false; if (other.getScale() != null && other.getScale().equals(this.getScale()) == false) return false; if (other.getArrayBaseColumnType() == null ^ this.getArrayBaseColumnType() == null) return false; if (other.getArrayBaseColumnType() != null && other.getArrayBaseColumnType().equals(this.getArrayBaseColumnType()) == 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 + ((getType() == null) ? 0 : getType().hashCode()); hashCode = prime * hashCode + ((getTypeName() == null) ? 0 : getTypeName().hashCode()); hashCode = prime * hashCode + ((getLabel() == null) ? 0 : getLabel().hashCode()); hashCode = prime * hashCode + ((getSchemaName() == null) ? 0 : getSchemaName().hashCode()); hashCode = prime * hashCode + ((getTableName() == null) ? 0 : getTableName().hashCode()); hashCode = prime * hashCode + ((getIsAutoIncrement() == null) ? 0 : getIsAutoIncrement().hashCode()); hashCode = prime * hashCode + ((getIsSigned() == null) ? 0 : getIsSigned().hashCode()); hashCode = prime * hashCode + ((getIsCurrency() == null) ? 0 : getIsCurrency().hashCode()); hashCode = prime * hashCode + ((getIsCaseSensitive() == null) ? 0 : getIsCaseSensitive().hashCode()); hashCode = prime * hashCode + ((getNullable() == null) ? 0 : getNullable().hashCode()); hashCode = prime * hashCode + ((getPrecision() == null) ? 0 : getPrecision().hashCode()); hashCode = prime * hashCode + ((getScale() == null) ? 0 : getScale().hashCode()); hashCode = prime * hashCode + ((getArrayBaseColumnType() == null) ? 0 : getArrayBaseColumnType().hashCode()); return hashCode; } @Override public ColumnMetadata clone() { try { return (ColumnMetadata) 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.rdsdata.model.transform.ColumnMetadataMarshaller.getInstance().marshall(this, protocolMarshaller); } }