/* * 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.iotevents.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* A structure that contains an asset property value. For more information, see Variant in the AWS IoT * SiteWise API Reference. *
*
* You must use expressions for all parameters in AssetPropertyVariant
. The expressions accept literals,
* operators, functions, references, and substitution templates.
*
* Examples *
*
* For literal values, the expressions must contain single quotes. For example, the value for the
* integerValue
parameter can be '100'
.
*
* For references, you must specify either variables or parameters. For example, the value for the
* booleanValue
parameter can be $variable.offline
.
*
* For a substitution template, you must use ${}
, and the template must be in single quotes. A substitution
* template can also contain a combination of literals, operators, functions, references, and substitution templates.
*
* In the following example, the value for the doubleValue
parameter uses a substitution template.
*
* '${$input.TemperatureInput.sensorData.temperature * 6 / 5 + 32}'
*
* For more information, see Expressions in the * AWS IoT Events Developer Guide. *
*
* You must specify one of the following value types, depending on the dataType
of the specified asset
* property. For more information, see AssetProperty in the
* AWS IoT SiteWise API Reference.
*
* The asset property value is a string. You must use an expression, and the evaluated result should be a string. *
*/ private String stringValue; /** ** The asset property value is an integer. You must use an expression, and the evaluated result should be an * integer. *
*/ private String integerValue; /** ** The asset property value is a double. You must use an expression, and the evaluated result should be a double. *
*/ private String doubleValue; /** *
* The asset property value is a Boolean value that must be 'TRUE'
or 'FALSE'
. You must
* use an expression, and the evaluated result should be a Boolean value.
*
* The asset property value is a string. You must use an expression, and the evaluated result should be a string. *
* * @param stringValue * The asset property value is a string. You must use an expression, and the evaluated result should be a * string. */ public void setStringValue(String stringValue) { this.stringValue = stringValue; } /** ** The asset property value is a string. You must use an expression, and the evaluated result should be a string. *
* * @return The asset property value is a string. You must use an expression, and the evaluated result should be a * string. */ public String getStringValue() { return this.stringValue; } /** ** The asset property value is a string. You must use an expression, and the evaluated result should be a string. *
* * @param stringValue * The asset property value is a string. You must use an expression, and the evaluated result should be a * string. * @return Returns a reference to this object so that method calls can be chained together. */ public AssetPropertyVariant withStringValue(String stringValue) { setStringValue(stringValue); return this; } /** ** The asset property value is an integer. You must use an expression, and the evaluated result should be an * integer. *
* * @param integerValue * The asset property value is an integer. You must use an expression, and the evaluated result should be an * integer. */ public void setIntegerValue(String integerValue) { this.integerValue = integerValue; } /** ** The asset property value is an integer. You must use an expression, and the evaluated result should be an * integer. *
* * @return The asset property value is an integer. You must use an expression, and the evaluated result should be an * integer. */ public String getIntegerValue() { return this.integerValue; } /** ** The asset property value is an integer. You must use an expression, and the evaluated result should be an * integer. *
* * @param integerValue * The asset property value is an integer. You must use an expression, and the evaluated result should be an * integer. * @return Returns a reference to this object so that method calls can be chained together. */ public AssetPropertyVariant withIntegerValue(String integerValue) { setIntegerValue(integerValue); return this; } /** ** The asset property value is a double. You must use an expression, and the evaluated result should be a double. *
* * @param doubleValue * The asset property value is a double. You must use an expression, and the evaluated result should be a * double. */ public void setDoubleValue(String doubleValue) { this.doubleValue = doubleValue; } /** ** The asset property value is a double. You must use an expression, and the evaluated result should be a double. *
* * @return The asset property value is a double. You must use an expression, and the evaluated result should be a * double. */ public String getDoubleValue() { return this.doubleValue; } /** ** The asset property value is a double. You must use an expression, and the evaluated result should be a double. *
* * @param doubleValue * The asset property value is a double. You must use an expression, and the evaluated result should be a * double. * @return Returns a reference to this object so that method calls can be chained together. */ public AssetPropertyVariant withDoubleValue(String doubleValue) { setDoubleValue(doubleValue); return this; } /** *
* The asset property value is a Boolean value that must be 'TRUE'
or 'FALSE'
. You must
* use an expression, and the evaluated result should be a Boolean value.
*
'TRUE'
or 'FALSE'
. You
* must use an expression, and the evaluated result should be a Boolean value.
*/
public void setBooleanValue(String booleanValue) {
this.booleanValue = booleanValue;
}
/**
*
* The asset property value is a Boolean value that must be 'TRUE'
or 'FALSE'
. You must
* use an expression, and the evaluated result should be a Boolean value.
*
'TRUE'
or 'FALSE'
. You
* must use an expression, and the evaluated result should be a Boolean value.
*/
public String getBooleanValue() {
return this.booleanValue;
}
/**
*
* The asset property value is a Boolean value that must be 'TRUE'
or 'FALSE'
. You must
* use an expression, and the evaluated result should be a Boolean value.
*
'TRUE'
or 'FALSE'
. You
* must use an expression, and the evaluated result should be a Boolean value.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AssetPropertyVariant withBooleanValue(String booleanValue) {
setBooleanValue(booleanValue);
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 (getIntegerValue() != null)
sb.append("IntegerValue: ").append(getIntegerValue()).append(",");
if (getDoubleValue() != null)
sb.append("DoubleValue: ").append(getDoubleValue()).append(",");
if (getBooleanValue() != null)
sb.append("BooleanValue: ").append(getBooleanValue());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof AssetPropertyVariant == false)
return false;
AssetPropertyVariant other = (AssetPropertyVariant) obj;
if (other.getStringValue() == null ^ this.getStringValue() == null)
return false;
if (other.getStringValue() != null && other.getStringValue().equals(this.getStringValue()) == false)
return false;
if (other.getIntegerValue() == null ^ this.getIntegerValue() == null)
return false;
if (other.getIntegerValue() != null && other.getIntegerValue().equals(this.getIntegerValue()) == false)
return false;
if (other.getDoubleValue() == null ^ this.getDoubleValue() == null)
return false;
if (other.getDoubleValue() != null && other.getDoubleValue().equals(this.getDoubleValue()) == false)
return false;
if (other.getBooleanValue() == null ^ this.getBooleanValue() == null)
return false;
if (other.getBooleanValue() != null && other.getBooleanValue().equals(this.getBooleanValue()) == 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 + ((getIntegerValue() == null) ? 0 : getIntegerValue().hashCode());
hashCode = prime * hashCode + ((getDoubleValue() == null) ? 0 : getDoubleValue().hashCode());
hashCode = prime * hashCode + ((getBooleanValue() == null) ? 0 : getBooleanValue().hashCode());
return hashCode;
}
@Override
public AssetPropertyVariant clone() {
try {
return (AssetPropertyVariant) 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.iotevents.model.transform.AssetPropertyVariantMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}