/* * 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; /** *
* A signal that represents static information about the vehicle, such as engine type or manufacturing date. *
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class Attribute implements Serializable, Cloneable, StructuredPojo { /** *
* The fully qualified name of the attribute. For example, the fully qualified name of an attribute might be
* Vehicle.Body.Engine.Type
.
*
* The specified data type of the attribute. *
*/ private String dataType; /** ** A brief description of the attribute. *
*/ private String description; /** ** The scientific unit for the attribute. *
*/ private String unit; /** ** A list of possible values an attribute can be assigned. *
*/ private java.util.List* The specified possible minimum value of the attribute. *
*/ private Double min; /** ** The specified possible maximum value of the attribute. *
*/ private Double max; /** ** A specified value for the attribute. *
*/ @Deprecated private String assignedValue; /** ** The default value of the attribute. *
*/ private String defaultValue; /** ** 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 attribute. For example, the fully qualified name of an attribute might be
* Vehicle.Body.Engine.Type
.
*
Vehicle.Body.Engine.Type
.
*/
public void setFullyQualifiedName(String fullyQualifiedName) {
this.fullyQualifiedName = fullyQualifiedName;
}
/**
*
* The fully qualified name of the attribute. For example, the fully qualified name of an attribute might be
* Vehicle.Body.Engine.Type
.
*
Vehicle.Body.Engine.Type
.
*/
public String getFullyQualifiedName() {
return this.fullyQualifiedName;
}
/**
*
* The fully qualified name of the attribute. For example, the fully qualified name of an attribute might be
* Vehicle.Body.Engine.Type
.
*
Vehicle.Body.Engine.Type
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Attribute withFullyQualifiedName(String fullyQualifiedName) {
setFullyQualifiedName(fullyQualifiedName);
return this;
}
/**
* * The specified data type of the attribute. *
* * @param dataType * The specified data type of the attribute. * @see NodeDataType */ public void setDataType(String dataType) { this.dataType = dataType; } /** ** The specified data type of the attribute. *
* * @return The specified data type of the attribute. * @see NodeDataType */ public String getDataType() { return this.dataType; } /** ** The specified data type of the attribute. *
* * @param dataType * The specified data type of the attribute. * @return Returns a reference to this object so that method calls can be chained together. * @see NodeDataType */ public Attribute withDataType(String dataType) { setDataType(dataType); return this; } /** ** The specified data type of the attribute. *
* * @param dataType * The specified data type of the attribute. * @return Returns a reference to this object so that method calls can be chained together. * @see NodeDataType */ public Attribute withDataType(NodeDataType dataType) { this.dataType = dataType.toString(); return this; } /** ** A brief description of the attribute. *
* * @param description * A brief description of the attribute. */ public void setDescription(String description) { this.description = description; } /** ** A brief description of the attribute. *
* * @return A brief description of the attribute. */ public String getDescription() { return this.description; } /** ** A brief description of the attribute. *
* * @param description * A brief description of the attribute. * @return Returns a reference to this object so that method calls can be chained together. */ public Attribute withDescription(String description) { setDescription(description); return this; } /** ** The scientific unit for the attribute. *
* * @param unit * The scientific unit for the attribute. */ public void setUnit(String unit) { this.unit = unit; } /** ** The scientific unit for the attribute. *
* * @return The scientific unit for the attribute. */ public String getUnit() { return this.unit; } /** ** The scientific unit for the attribute. *
* * @param unit * The scientific unit for the attribute. * @return Returns a reference to this object so that method calls can be chained together. */ public Attribute withUnit(String unit) { setUnit(unit); return this; } /** ** A list of possible values an attribute can be assigned. *
* * @return A list of possible values an attribute can be assigned. */ public java.util.List* A list of possible values an attribute can be assigned. *
* * @param allowedValues * A list of possible values an attribute can be assigned. */ public void setAllowedValues(java.util.Collection* A list of possible values an attribute can be assigned. *
** 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 an attribute can be assigned. * @return Returns a reference to this object so that method calls can be chained together. */ public Attribute withAllowedValues(String... allowedValues) { if (this.allowedValues == null) { setAllowedValues(new java.util.ArrayList* A list of possible values an attribute can be assigned. *
* * @param allowedValues * A list of possible values an attribute can be assigned. * @return Returns a reference to this object so that method calls can be chained together. */ public Attribute withAllowedValues(java.util.Collection* The specified possible minimum value of the attribute. *
* * @param min * The specified possible minimum value of the attribute. */ public void setMin(Double min) { this.min = min; } /** ** The specified possible minimum value of the attribute. *
* * @return The specified possible minimum value of the attribute. */ public Double getMin() { return this.min; } /** ** The specified possible minimum value of the attribute. *
* * @param min * The specified possible minimum value of the attribute. * @return Returns a reference to this object so that method calls can be chained together. */ public Attribute withMin(Double min) { setMin(min); return this; } /** ** The specified possible maximum value of the attribute. *
* * @param max * The specified possible maximum value of the attribute. */ public void setMax(Double max) { this.max = max; } /** ** The specified possible maximum value of the attribute. *
* * @return The specified possible maximum value of the attribute. */ public Double getMax() { return this.max; } /** ** The specified possible maximum value of the attribute. *
* * @param max * The specified possible maximum value of the attribute. * @return Returns a reference to this object so that method calls can be chained together. */ public Attribute withMax(Double max) { setMax(max); return this; } /** ** A specified value for the attribute. *
* * @param assignedValue * A specified value for the attribute. */ @Deprecated public void setAssignedValue(String assignedValue) { this.assignedValue = assignedValue; } /** ** A specified value for the attribute. *
* * @return A specified value for the attribute. */ @Deprecated public String getAssignedValue() { return this.assignedValue; } /** ** A specified value for the attribute. *
* * @param assignedValue * A specified value for the attribute. * @return Returns a reference to this object so that method calls can be chained together. */ @Deprecated public Attribute withAssignedValue(String assignedValue) { setAssignedValue(assignedValue); return this; } /** ** The default value of the attribute. *
* * @param defaultValue * The default value of the attribute. */ public void setDefaultValue(String defaultValue) { this.defaultValue = defaultValue; } /** ** The default value of the attribute. *
* * @return The default value of the attribute. */ public String getDefaultValue() { return this.defaultValue; } /** ** The default value of the attribute. *
* * @param defaultValue * The default value of the attribute. * @return Returns a reference to this object so that method calls can be chained together. */ public Attribute withDefaultValue(String defaultValue) { setDefaultValue(defaultValue); 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 Attribute 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 Attribute 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 (getAssignedValue() != null) sb.append("AssignedValue: ").append(getAssignedValue()).append(","); if (getDefaultValue() != null) sb.append("DefaultValue: ").append(getDefaultValue()).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 Attribute == false) return false; Attribute other = (Attribute) 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.getAssignedValue() == null ^ this.getAssignedValue() == null) return false; if (other.getAssignedValue() != null && other.getAssignedValue().equals(this.getAssignedValue()) == false) return false; if (other.getDefaultValue() == null ^ this.getDefaultValue() == null) return false; if (other.getDefaultValue() != null && other.getDefaultValue().equals(this.getDefaultValue()) == 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 + ((getAssignedValue() == null) ? 0 : getAssignedValue().hashCode()); hashCode = prime * hashCode + ((getDefaultValue() == null) ? 0 : getDefaultValue().hashCode()); hashCode = prime * hashCode + ((getDeprecationMessage() == null) ? 0 : getDeprecationMessage().hashCode()); hashCode = prime * hashCode + ((getComment() == null) ? 0 : getComment().hashCode()); return hashCode; } @Override public Attribute clone() { try { return (Attribute) 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.AttributeMarshaller.getInstance().marshall(this, protocolMarshaller); } }