com.amazonaws.services.qapps.model.DocumentAttributeValue Maven / Gradle / Ivy
Show all versions of aws-java-sdk-qapps Show documentation
/*
* Copyright 2019-2024 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.qapps.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* The value of a document attribute. You can only provide one value for a document attribute.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class DocumentAttributeValue implements Serializable, Cloneable, StructuredPojo {
/**
*
* A string.
*
*/
private String stringValue;
/**
*
* A list of strings.
*
*/
private java.util.List stringListValue;
/**
*
* A long integer value.
*
*/
private Long longValue;
/**
*
* A date expressed as an ISO 8601 string.
*
*
* It's important for the time zone to be included in the ISO 8601 date-time format. For example,
* 2012-03-25T12:30:10+01:00 is the ISO 8601 date-time format for March 25th 2012 at 12:30PM (plus 10 seconds) in
* Central European Time.
*
*/
private java.util.Date dateValue;
/**
*
* A string.
*
*
* @param stringValue
* A string.
*/
public void setStringValue(String stringValue) {
this.stringValue = stringValue;
}
/**
*
* A string.
*
*
* @return A string.
*/
public String getStringValue() {
return this.stringValue;
}
/**
*
* A string.
*
*
* @param stringValue
* A string.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DocumentAttributeValue withStringValue(String stringValue) {
setStringValue(stringValue);
return this;
}
/**
*
* A list of strings.
*
*
* @return A list of strings.
*/
public java.util.List getStringListValue() {
return stringListValue;
}
/**
*
* A list of strings.
*
*
* @param stringListValue
* A list of strings.
*/
public void setStringListValue(java.util.Collection stringListValue) {
if (stringListValue == null) {
this.stringListValue = null;
return;
}
this.stringListValue = new java.util.ArrayList(stringListValue);
}
/**
*
* A list of strings.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setStringListValue(java.util.Collection)} or {@link #withStringListValue(java.util.Collection)} if you
* want to override the existing values.
*
*
* @param stringListValue
* A list of strings.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DocumentAttributeValue withStringListValue(String... stringListValue) {
if (this.stringListValue == null) {
setStringListValue(new java.util.ArrayList(stringListValue.length));
}
for (String ele : stringListValue) {
this.stringListValue.add(ele);
}
return this;
}
/**
*
* A list of strings.
*
*
* @param stringListValue
* A list of strings.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DocumentAttributeValue withStringListValue(java.util.Collection stringListValue) {
setStringListValue(stringListValue);
return this;
}
/**
*
* A long integer value.
*
*
* @param longValue
* A long integer value.
*/
public void setLongValue(Long longValue) {
this.longValue = longValue;
}
/**
*
* A long integer value.
*
*
* @return A long integer value.
*/
public Long getLongValue() {
return this.longValue;
}
/**
*
* A long integer value.
*
*
* @param longValue
* A long integer value.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DocumentAttributeValue withLongValue(Long longValue) {
setLongValue(longValue);
return this;
}
/**
*
* A date expressed as an ISO 8601 string.
*
*
* It's important for the time zone to be included in the ISO 8601 date-time format. For example,
* 2012-03-25T12:30:10+01:00 is the ISO 8601 date-time format for March 25th 2012 at 12:30PM (plus 10 seconds) in
* Central European Time.
*
*
* @param dateValue
* A date expressed as an ISO 8601 string.
*
* It's important for the time zone to be included in the ISO 8601 date-time format. For example,
* 2012-03-25T12:30:10+01:00 is the ISO 8601 date-time format for March 25th 2012 at 12:30PM (plus 10
* seconds) in Central European Time.
*/
public void setDateValue(java.util.Date dateValue) {
this.dateValue = dateValue;
}
/**
*
* A date expressed as an ISO 8601 string.
*
*
* It's important for the time zone to be included in the ISO 8601 date-time format. For example,
* 2012-03-25T12:30:10+01:00 is the ISO 8601 date-time format for March 25th 2012 at 12:30PM (plus 10 seconds) in
* Central European Time.
*
*
* @return A date expressed as an ISO 8601 string.
*
* It's important for the time zone to be included in the ISO 8601 date-time format. For example,
* 2012-03-25T12:30:10+01:00 is the ISO 8601 date-time format for March 25th 2012 at 12:30PM (plus 10
* seconds) in Central European Time.
*/
public java.util.Date getDateValue() {
return this.dateValue;
}
/**
*
* A date expressed as an ISO 8601 string.
*
*
* It's important for the time zone to be included in the ISO 8601 date-time format. For example,
* 2012-03-25T12:30:10+01:00 is the ISO 8601 date-time format for March 25th 2012 at 12:30PM (plus 10 seconds) in
* Central European Time.
*
*
* @param dateValue
* A date expressed as an ISO 8601 string.
*
* It's important for the time zone to be included in the ISO 8601 date-time format. For example,
* 2012-03-25T12:30:10+01:00 is the ISO 8601 date-time format for March 25th 2012 at 12:30PM (plus 10
* seconds) in Central European Time.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DocumentAttributeValue withDateValue(java.util.Date dateValue) {
setDateValue(dateValue);
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 (getStringValue() != null)
sb.append("StringValue: ").append(getStringValue()).append(",");
if (getStringListValue() != null)
sb.append("StringListValue: ").append(getStringListValue()).append(",");
if (getLongValue() != null)
sb.append("LongValue: ").append(getLongValue()).append(",");
if (getDateValue() != null)
sb.append("DateValue: ").append(getDateValue());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof DocumentAttributeValue == false)
return false;
DocumentAttributeValue other = (DocumentAttributeValue) obj;
if (other.getStringValue() == null ^ this.getStringValue() == null)
return false;
if (other.getStringValue() != null && other.getStringValue().equals(this.getStringValue()) == false)
return false;
if (other.getStringListValue() == null ^ this.getStringListValue() == null)
return false;
if (other.getStringListValue() != null && other.getStringListValue().equals(this.getStringListValue()) == false)
return false;
if (other.getLongValue() == null ^ this.getLongValue() == null)
return false;
if (other.getLongValue() != null && other.getLongValue().equals(this.getLongValue()) == false)
return false;
if (other.getDateValue() == null ^ this.getDateValue() == null)
return false;
if (other.getDateValue() != null && other.getDateValue().equals(this.getDateValue()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getStringValue() == null) ? 0 : getStringValue().hashCode());
hashCode = prime * hashCode + ((getStringListValue() == null) ? 0 : getStringListValue().hashCode());
hashCode = prime * hashCode + ((getLongValue() == null) ? 0 : getLongValue().hashCode());
hashCode = prime * hashCode + ((getDateValue() == null) ? 0 : getDateValue().hashCode());
return hashCode;
}
@Override
public DocumentAttributeValue clone() {
try {
return (DocumentAttributeValue) 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.qapps.model.transform.DocumentAttributeValueMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}