/* * 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.iotfleetwise.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* An input component that reports the environmental condition of a vehicle. *
** You can collect data about fluid levels, temperatures, vibrations, or battery voltage from sensors. *
*
* The fully qualified name of the sensor. For example, the fully qualified name of a sensor might be
* Vehicle.Body.Engine.Battery
.
*
* The specified data type of the sensor. *
*/ private String dataType; /** ** A brief description of a sensor. *
*/ private String description; /** ** The scientific unit of measurement for data collected by the sensor. *
*/ private String unit; /** ** A list of possible values a sensor can take. *
*/ private java.util.List* The specified possible minimum value of the sensor. *
*/ private Double min; /** ** The specified possible maximum value of the sensor. *
*/ private Double max; /** ** The deprecation message for the node or the branch that was moved or deleted. *
*/ private String deprecationMessage; /** ** A comment in addition to the description. *
*/ private String comment; /** *
* The fully qualified name of the sensor. For example, the fully qualified name of a sensor might be
* Vehicle.Body.Engine.Battery
.
*
Vehicle.Body.Engine.Battery
.
*/
public void setFullyQualifiedName(String fullyQualifiedName) {
this.fullyQualifiedName = fullyQualifiedName;
}
/**
*
* The fully qualified name of the sensor. For example, the fully qualified name of a sensor might be
* Vehicle.Body.Engine.Battery
.
*
Vehicle.Body.Engine.Battery
.
*/
public String getFullyQualifiedName() {
return this.fullyQualifiedName;
}
/**
*
* The fully qualified name of the sensor. For example, the fully qualified name of a sensor might be
* Vehicle.Body.Engine.Battery
.
*
Vehicle.Body.Engine.Battery
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Sensor withFullyQualifiedName(String fullyQualifiedName) {
setFullyQualifiedName(fullyQualifiedName);
return this;
}
/**
* * The specified data type of the sensor. *
* * @param dataType * The specified data type of the sensor. * @see NodeDataType */ public void setDataType(String dataType) { this.dataType = dataType; } /** ** The specified data type of the sensor. *
* * @return The specified data type of the sensor. * @see NodeDataType */ public String getDataType() { return this.dataType; } /** ** The specified data type of the sensor. *
* * @param dataType * The specified data type of the sensor. * @return Returns a reference to this object so that method calls can be chained together. * @see NodeDataType */ public Sensor withDataType(String dataType) { setDataType(dataType); return this; } /** ** The specified data type of the sensor. *
* * @param dataType * The specified data type of the sensor. * @return Returns a reference to this object so that method calls can be chained together. * @see NodeDataType */ public Sensor withDataType(NodeDataType dataType) { this.dataType = dataType.toString(); return this; } /** ** A brief description of a sensor. *
* * @param description * A brief description of a sensor. */ public void setDescription(String description) { this.description = description; } /** ** A brief description of a sensor. *
* * @return A brief description of a sensor. */ public String getDescription() { return this.description; } /** ** A brief description of a sensor. *
* * @param description * A brief description of a sensor. * @return Returns a reference to this object so that method calls can be chained together. */ public Sensor withDescription(String description) { setDescription(description); return this; } /** ** The scientific unit of measurement for data collected by the sensor. *
* * @param unit * The scientific unit of measurement for data collected by the sensor. */ public void setUnit(String unit) { this.unit = unit; } /** ** The scientific unit of measurement for data collected by the sensor. *
* * @return The scientific unit of measurement for data collected by the sensor. */ public String getUnit() { return this.unit; } /** ** The scientific unit of measurement for data collected by the sensor. *
* * @param unit * The scientific unit of measurement for data collected by the sensor. * @return Returns a reference to this object so that method calls can be chained together. */ public Sensor withUnit(String unit) { setUnit(unit); return this; } /** ** A list of possible values a sensor can take. *
* * @return A list of possible values a sensor can take. */ public java.util.List* A list of possible values a sensor can take. *
* * @param allowedValues * A list of possible values a sensor can take. */ public void setAllowedValues(java.util.Collection* A list of possible values a sensor can take. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setAllowedValues(java.util.Collection)} or {@link #withAllowedValues(java.util.Collection)} if you want * to override the existing values. *
* * @param allowedValues * A list of possible values a sensor can take. * @return Returns a reference to this object so that method calls can be chained together. */ public Sensor withAllowedValues(String... allowedValues) { if (this.allowedValues == null) { setAllowedValues(new java.util.ArrayList* A list of possible values a sensor can take. *
* * @param allowedValues * A list of possible values a sensor can take. * @return Returns a reference to this object so that method calls can be chained together. */ public Sensor withAllowedValues(java.util.Collection* The specified possible minimum value of the sensor. *
* * @param min * The specified possible minimum value of the sensor. */ public void setMin(Double min) { this.min = min; } /** ** The specified possible minimum value of the sensor. *
* * @return The specified possible minimum value of the sensor. */ public Double getMin() { return this.min; } /** ** The specified possible minimum value of the sensor. *
* * @param min * The specified possible minimum value of the sensor. * @return Returns a reference to this object so that method calls can be chained together. */ public Sensor withMin(Double min) { setMin(min); return this; } /** ** The specified possible maximum value of the sensor. *
* * @param max * The specified possible maximum value of the sensor. */ public void setMax(Double max) { this.max = max; } /** ** The specified possible maximum value of the sensor. *
* * @return The specified possible maximum value of the sensor. */ public Double getMax() { return this.max; } /** ** The specified possible maximum value of the sensor. *
* * @param max * The specified possible maximum value of the sensor. * @return Returns a reference to this object so that method calls can be chained together. */ public Sensor withMax(Double max) { setMax(max); return this; } /** ** The deprecation message for the node or the branch that was moved or deleted. *
* * @param deprecationMessage * The deprecation message for the node or the branch that was moved or deleted. */ public void setDeprecationMessage(String deprecationMessage) { this.deprecationMessage = deprecationMessage; } /** ** The deprecation message for the node or the branch that was moved or deleted. *
* * @return The deprecation message for the node or the branch that was moved or deleted. */ public String getDeprecationMessage() { return this.deprecationMessage; } /** ** The deprecation message for the node or the branch that was moved or deleted. *
* * @param deprecationMessage * The deprecation message for the node or the branch that was moved or deleted. * @return Returns a reference to this object so that method calls can be chained together. */ public Sensor withDeprecationMessage(String deprecationMessage) { setDeprecationMessage(deprecationMessage); return this; } /** ** A comment in addition to the description. *
* * @param comment * A comment in addition to the description. */ public void setComment(String comment) { this.comment = comment; } /** ** A comment in addition to the description. *
* * @return A comment in addition to the description. */ public String getComment() { return this.comment; } /** ** A comment in addition to the description. *
* * @param comment * A comment in addition to the description. * @return Returns a reference to this object so that method calls can be chained together. */ public Sensor withComment(String comment) { setComment(comment); 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 (getFullyQualifiedName() != null) sb.append("FullyQualifiedName: ").append(getFullyQualifiedName()).append(","); if (getDataType() != null) sb.append("DataType: ").append(getDataType()).append(","); if (getDescription() != null) sb.append("Description: ").append(getDescription()).append(","); if (getUnit() != null) sb.append("Unit: ").append(getUnit()).append(","); if (getAllowedValues() != null) sb.append("AllowedValues: ").append(getAllowedValues()).append(","); if (getMin() != null) sb.append("Min: ").append(getMin()).append(","); if (getMax() != null) sb.append("Max: ").append(getMax()).append(","); if (getDeprecationMessage() != null) sb.append("DeprecationMessage: ").append(getDeprecationMessage()).append(","); if (getComment() != null) sb.append("Comment: ").append(getComment()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof Sensor == false) return false; Sensor other = (Sensor) obj; if (other.getFullyQualifiedName() == null ^ this.getFullyQualifiedName() == null) return false; if (other.getFullyQualifiedName() != null && other.getFullyQualifiedName().equals(this.getFullyQualifiedName()) == false) return false; if (other.getDataType() == null ^ this.getDataType() == null) return false; if (other.getDataType() != null && other.getDataType().equals(this.getDataType()) == false) return false; if (other.getDescription() == null ^ this.getDescription() == null) return false; if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == false) return false; if (other.getUnit() == null ^ this.getUnit() == null) return false; if (other.getUnit() != null && other.getUnit().equals(this.getUnit()) == false) return false; if (other.getAllowedValues() == null ^ this.getAllowedValues() == null) return false; if (other.getAllowedValues() != null && other.getAllowedValues().equals(this.getAllowedValues()) == false) return false; if (other.getMin() == null ^ this.getMin() == null) return false; if (other.getMin() != null && other.getMin().equals(this.getMin()) == false) return false; if (other.getMax() == null ^ this.getMax() == null) return false; if (other.getMax() != null && other.getMax().equals(this.getMax()) == false) return false; if (other.getDeprecationMessage() == null ^ this.getDeprecationMessage() == null) return false; if (other.getDeprecationMessage() != null && other.getDeprecationMessage().equals(this.getDeprecationMessage()) == false) return false; if (other.getComment() == null ^ this.getComment() == null) return false; if (other.getComment() != null && other.getComment().equals(this.getComment()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getFullyQualifiedName() == null) ? 0 : getFullyQualifiedName().hashCode()); hashCode = prime * hashCode + ((getDataType() == null) ? 0 : getDataType().hashCode()); hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode()); hashCode = prime * hashCode + ((getUnit() == null) ? 0 : getUnit().hashCode()); hashCode = prime * hashCode + ((getAllowedValues() == null) ? 0 : getAllowedValues().hashCode()); hashCode = prime * hashCode + ((getMin() == null) ? 0 : getMin().hashCode()); hashCode = prime * hashCode + ((getMax() == null) ? 0 : getMax().hashCode()); hashCode = prime * hashCode + ((getDeprecationMessage() == null) ? 0 : getDeprecationMessage().hashCode()); hashCode = prime * hashCode + ((getComment() == null) ? 0 : getComment().hashCode()); return hashCode; } @Override public Sensor clone() { try { return (Sensor) 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.iotfleetwise.model.transform.SensorMarshaller.getInstance().marshall(this, protocolMarshaller); } }