/* * 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 an array. *

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

* An array of Boolean values. *

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

* An array of integers. *

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

* An array of floating-point numbers. *

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

* An array of strings. *

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

* An array of arrays. *

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

* An array of Boolean values. *

* * @return An array of Boolean values. */ public java.util.List getBooleanValues() { return booleanValues; } /** *

* An array of Boolean values. *

* * @param booleanValues * An array of Boolean values. */ public void setBooleanValues(java.util.Collection booleanValues) { if (booleanValues == null) { this.booleanValues = null; return; } this.booleanValues = new java.util.ArrayList(booleanValues); } /** *

* An array of Boolean values. *

*

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

* * @param booleanValues * An array of Boolean values. * @return Returns a reference to this object so that method calls can be chained together. */ public ArrayValue withBooleanValues(Boolean... booleanValues) { if (this.booleanValues == null) { setBooleanValues(new java.util.ArrayList(booleanValues.length)); } for (Boolean ele : booleanValues) { this.booleanValues.add(ele); } return this; } /** *

* An array of Boolean values. *

* * @param booleanValues * An array of Boolean values. * @return Returns a reference to this object so that method calls can be chained together. */ public ArrayValue withBooleanValues(java.util.Collection booleanValues) { setBooleanValues(booleanValues); return this; } /** *

* An array of integers. *

* * @return An array of integers. */ public java.util.List getLongValues() { return longValues; } /** *

* An array of integers. *

* * @param longValues * An array of integers. */ public void setLongValues(java.util.Collection longValues) { if (longValues == null) { this.longValues = null; return; } this.longValues = new java.util.ArrayList(longValues); } /** *

* An array of integers. *

*

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

* * @param longValues * An array of integers. * @return Returns a reference to this object so that method calls can be chained together. */ public ArrayValue withLongValues(Long... longValues) { if (this.longValues == null) { setLongValues(new java.util.ArrayList(longValues.length)); } for (Long ele : longValues) { this.longValues.add(ele); } return this; } /** *

* An array of integers. *

* * @param longValues * An array of integers. * @return Returns a reference to this object so that method calls can be chained together. */ public ArrayValue withLongValues(java.util.Collection longValues) { setLongValues(longValues); return this; } /** *

* An array of floating-point numbers. *

* * @return An array of floating-point numbers. */ public java.util.List getDoubleValues() { return doubleValues; } /** *

* An array of floating-point numbers. *

* * @param doubleValues * An array of floating-point numbers. */ public void setDoubleValues(java.util.Collection doubleValues) { if (doubleValues == null) { this.doubleValues = null; return; } this.doubleValues = new java.util.ArrayList(doubleValues); } /** *

* An array of floating-point numbers. *

*

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

* * @param doubleValues * An array of floating-point numbers. * @return Returns a reference to this object so that method calls can be chained together. */ public ArrayValue withDoubleValues(Double... doubleValues) { if (this.doubleValues == null) { setDoubleValues(new java.util.ArrayList(doubleValues.length)); } for (Double ele : doubleValues) { this.doubleValues.add(ele); } return this; } /** *

* An array of floating-point numbers. *

* * @param doubleValues * An array of floating-point numbers. * @return Returns a reference to this object so that method calls can be chained together. */ public ArrayValue withDoubleValues(java.util.Collection doubleValues) { setDoubleValues(doubleValues); return this; } /** *

* An array of strings. *

* * @return An array of strings. */ public java.util.List getStringValues() { return stringValues; } /** *

* An array of strings. *

* * @param stringValues * An array of strings. */ public void setStringValues(java.util.Collection stringValues) { if (stringValues == null) { this.stringValues = null; return; } this.stringValues = new java.util.ArrayList(stringValues); } /** *

* An array of strings. *

*

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

* * @param stringValues * An array of strings. * @return Returns a reference to this object so that method calls can be chained together. */ public ArrayValue withStringValues(String... stringValues) { if (this.stringValues == null) { setStringValues(new java.util.ArrayList(stringValues.length)); } for (String ele : stringValues) { this.stringValues.add(ele); } return this; } /** *

* An array of strings. *

* * @param stringValues * An array of strings. * @return Returns a reference to this object so that method calls can be chained together. */ public ArrayValue withStringValues(java.util.Collection stringValues) { setStringValues(stringValues); return this; } /** *

* An array of arrays. *

* * @return An array of arrays. */ public java.util.List getArrayValues() { return arrayValues; } /** *

* An array of arrays. *

* * @param arrayValues * An array of arrays. */ public void setArrayValues(java.util.Collection arrayValues) { if (arrayValues == null) { this.arrayValues = null; return; } this.arrayValues = new java.util.ArrayList(arrayValues); } /** *

* An array of arrays. *

*

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

* * @param arrayValues * An array of arrays. * @return Returns a reference to this object so that method calls can be chained together. */ public ArrayValue withArrayValues(ArrayValue... arrayValues) { if (this.arrayValues == null) { setArrayValues(new java.util.ArrayList(arrayValues.length)); } for (ArrayValue ele : arrayValues) { this.arrayValues.add(ele); } return this; } /** *

* An array of arrays. *

* * @param arrayValues * An array of arrays. * @return Returns a reference to this object so that method calls can be chained together. */ public ArrayValue withArrayValues(java.util.Collection arrayValues) { setArrayValues(arrayValues); 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 (getBooleanValues() != null) sb.append("BooleanValues: ").append(getBooleanValues()).append(","); if (getLongValues() != null) sb.append("LongValues: ").append(getLongValues()).append(","); if (getDoubleValues() != null) sb.append("DoubleValues: ").append(getDoubleValues()).append(","); if (getStringValues() != null) sb.append("StringValues: ").append(getStringValues()).append(","); if (getArrayValues() != null) sb.append("ArrayValues: ").append(getArrayValues()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ArrayValue == false) return false; ArrayValue other = (ArrayValue) obj; if (other.getBooleanValues() == null ^ this.getBooleanValues() == null) return false; if (other.getBooleanValues() != null && other.getBooleanValues().equals(this.getBooleanValues()) == false) return false; if (other.getLongValues() == null ^ this.getLongValues() == null) return false; if (other.getLongValues() != null && other.getLongValues().equals(this.getLongValues()) == false) return false; if (other.getDoubleValues() == null ^ this.getDoubleValues() == null) return false; if (other.getDoubleValues() != null && other.getDoubleValues().equals(this.getDoubleValues()) == false) return false; if (other.getStringValues() == null ^ this.getStringValues() == null) return false; if (other.getStringValues() != null && other.getStringValues().equals(this.getStringValues()) == false) return false; if (other.getArrayValues() == null ^ this.getArrayValues() == null) return false; if (other.getArrayValues() != null && other.getArrayValues().equals(this.getArrayValues()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getBooleanValues() == null) ? 0 : getBooleanValues().hashCode()); hashCode = prime * hashCode + ((getLongValues() == null) ? 0 : getLongValues().hashCode()); hashCode = prime * hashCode + ((getDoubleValues() == null) ? 0 : getDoubleValues().hashCode()); hashCode = prime * hashCode + ((getStringValues() == null) ? 0 : getStringValues().hashCode()); hashCode = prime * hashCode + ((getArrayValues() == null) ? 0 : getArrayValues().hashCode()); return hashCode; } @Override public ArrayValue clone() { try { return (ArrayValue) 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.ArrayValueMarshaller.getInstance().marshall(this, protocolMarshaller); } }