/* * 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; /** *

* Information about signal messages using the on-board diagnostics (OBD) II protocol in a vehicle. *

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

* The length of the requested data. *

*/ private Integer pidResponseLength; /** *

* The mode of operation (diagnostic service) in a message. *

*/ private Integer serviceMode; /** *

* The diagnostic code used to request data from a vehicle for this signal. *

*/ private Integer pid; /** *

* A multiplier used to decode the message. *

*/ private Double scaling; /** *

* The offset used to calculate the signal value. Combined with scaling, the calculation is * value = raw_value * scaling + offset. *

*/ private Double offset; /** *

* Indicates the beginning of the message. *

*/ private Integer startByte; /** *

* The length of a message. *

*/ private Integer byteLength; /** *

* The number of positions to shift bits in the message. *

*/ private Integer bitRightShift; /** *

* The number of bits to mask in a message. *

*/ private Integer bitMaskLength; /** *

* The length of the requested data. *

* * @param pidResponseLength * The length of the requested data. */ public void setPidResponseLength(Integer pidResponseLength) { this.pidResponseLength = pidResponseLength; } /** *

* The length of the requested data. *

* * @return The length of the requested data. */ public Integer getPidResponseLength() { return this.pidResponseLength; } /** *

* The length of the requested data. *

* * @param pidResponseLength * The length of the requested data. * @return Returns a reference to this object so that method calls can be chained together. */ public ObdSignal withPidResponseLength(Integer pidResponseLength) { setPidResponseLength(pidResponseLength); return this; } /** *

* The mode of operation (diagnostic service) in a message. *

* * @param serviceMode * The mode of operation (diagnostic service) in a message. */ public void setServiceMode(Integer serviceMode) { this.serviceMode = serviceMode; } /** *

* The mode of operation (diagnostic service) in a message. *

* * @return The mode of operation (diagnostic service) in a message. */ public Integer getServiceMode() { return this.serviceMode; } /** *

* The mode of operation (diagnostic service) in a message. *

* * @param serviceMode * The mode of operation (diagnostic service) in a message. * @return Returns a reference to this object so that method calls can be chained together. */ public ObdSignal withServiceMode(Integer serviceMode) { setServiceMode(serviceMode); return this; } /** *

* The diagnostic code used to request data from a vehicle for this signal. *

* * @param pid * The diagnostic code used to request data from a vehicle for this signal. */ public void setPid(Integer pid) { this.pid = pid; } /** *

* The diagnostic code used to request data from a vehicle for this signal. *

* * @return The diagnostic code used to request data from a vehicle for this signal. */ public Integer getPid() { return this.pid; } /** *

* The diagnostic code used to request data from a vehicle for this signal. *

* * @param pid * The diagnostic code used to request data from a vehicle for this signal. * @return Returns a reference to this object so that method calls can be chained together. */ public ObdSignal withPid(Integer pid) { setPid(pid); return this; } /** *

* A multiplier used to decode the message. *

* * @param scaling * A multiplier used to decode the message. */ public void setScaling(Double scaling) { this.scaling = scaling; } /** *

* A multiplier used to decode the message. *

* * @return A multiplier used to decode the message. */ public Double getScaling() { return this.scaling; } /** *

* A multiplier used to decode the message. *

* * @param scaling * A multiplier used to decode the message. * @return Returns a reference to this object so that method calls can be chained together. */ public ObdSignal withScaling(Double scaling) { setScaling(scaling); return this; } /** *

* The offset used to calculate the signal value. Combined with scaling, the calculation is * value = raw_value * scaling + offset. *

* * @param offset * The offset used to calculate the signal value. Combined with scaling, the calculation is * value = raw_value * scaling + offset. */ public void setOffset(Double offset) { this.offset = offset; } /** *

* The offset used to calculate the signal value. Combined with scaling, the calculation is * value = raw_value * scaling + offset. *

* * @return The offset used to calculate the signal value. Combined with scaling, the calculation is * value = raw_value * scaling + offset. */ public Double getOffset() { return this.offset; } /** *

* The offset used to calculate the signal value. Combined with scaling, the calculation is * value = raw_value * scaling + offset. *

* * @param offset * The offset used to calculate the signal value. Combined with scaling, the calculation is * value = raw_value * scaling + offset. * @return Returns a reference to this object so that method calls can be chained together. */ public ObdSignal withOffset(Double offset) { setOffset(offset); return this; } /** *

* Indicates the beginning of the message. *

* * @param startByte * Indicates the beginning of the message. */ public void setStartByte(Integer startByte) { this.startByte = startByte; } /** *

* Indicates the beginning of the message. *

* * @return Indicates the beginning of the message. */ public Integer getStartByte() { return this.startByte; } /** *

* Indicates the beginning of the message. *

* * @param startByte * Indicates the beginning of the message. * @return Returns a reference to this object so that method calls can be chained together. */ public ObdSignal withStartByte(Integer startByte) { setStartByte(startByte); return this; } /** *

* The length of a message. *

* * @param byteLength * The length of a message. */ public void setByteLength(Integer byteLength) { this.byteLength = byteLength; } /** *

* The length of a message. *

* * @return The length of a message. */ public Integer getByteLength() { return this.byteLength; } /** *

* The length of a message. *

* * @param byteLength * The length of a message. * @return Returns a reference to this object so that method calls can be chained together. */ public ObdSignal withByteLength(Integer byteLength) { setByteLength(byteLength); return this; } /** *

* The number of positions to shift bits in the message. *

* * @param bitRightShift * The number of positions to shift bits in the message. */ public void setBitRightShift(Integer bitRightShift) { this.bitRightShift = bitRightShift; } /** *

* The number of positions to shift bits in the message. *

* * @return The number of positions to shift bits in the message. */ public Integer getBitRightShift() { return this.bitRightShift; } /** *

* The number of positions to shift bits in the message. *

* * @param bitRightShift * The number of positions to shift bits in the message. * @return Returns a reference to this object so that method calls can be chained together. */ public ObdSignal withBitRightShift(Integer bitRightShift) { setBitRightShift(bitRightShift); return this; } /** *

* The number of bits to mask in a message. *

* * @param bitMaskLength * The number of bits to mask in a message. */ public void setBitMaskLength(Integer bitMaskLength) { this.bitMaskLength = bitMaskLength; } /** *

* The number of bits to mask in a message. *

* * @return The number of bits to mask in a message. */ public Integer getBitMaskLength() { return this.bitMaskLength; } /** *

* The number of bits to mask in a message. *

* * @param bitMaskLength * The number of bits to mask in a message. * @return Returns a reference to this object so that method calls can be chained together. */ public ObdSignal withBitMaskLength(Integer bitMaskLength) { setBitMaskLength(bitMaskLength); 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 (getPidResponseLength() != null) sb.append("PidResponseLength: ").append(getPidResponseLength()).append(","); if (getServiceMode() != null) sb.append("ServiceMode: ").append(getServiceMode()).append(","); if (getPid() != null) sb.append("Pid: ").append(getPid()).append(","); if (getScaling() != null) sb.append("Scaling: ").append(getScaling()).append(","); if (getOffset() != null) sb.append("Offset: ").append(getOffset()).append(","); if (getStartByte() != null) sb.append("StartByte: ").append(getStartByte()).append(","); if (getByteLength() != null) sb.append("ByteLength: ").append(getByteLength()).append(","); if (getBitRightShift() != null) sb.append("BitRightShift: ").append(getBitRightShift()).append(","); if (getBitMaskLength() != null) sb.append("BitMaskLength: ").append(getBitMaskLength()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ObdSignal == false) return false; ObdSignal other = (ObdSignal) obj; if (other.getPidResponseLength() == null ^ this.getPidResponseLength() == null) return false; if (other.getPidResponseLength() != null && other.getPidResponseLength().equals(this.getPidResponseLength()) == false) return false; if (other.getServiceMode() == null ^ this.getServiceMode() == null) return false; if (other.getServiceMode() != null && other.getServiceMode().equals(this.getServiceMode()) == false) return false; if (other.getPid() == null ^ this.getPid() == null) return false; if (other.getPid() != null && other.getPid().equals(this.getPid()) == false) return false; if (other.getScaling() == null ^ this.getScaling() == null) return false; if (other.getScaling() != null && other.getScaling().equals(this.getScaling()) == false) return false; if (other.getOffset() == null ^ this.getOffset() == null) return false; if (other.getOffset() != null && other.getOffset().equals(this.getOffset()) == false) return false; if (other.getStartByte() == null ^ this.getStartByte() == null) return false; if (other.getStartByte() != null && other.getStartByte().equals(this.getStartByte()) == false) return false; if (other.getByteLength() == null ^ this.getByteLength() == null) return false; if (other.getByteLength() != null && other.getByteLength().equals(this.getByteLength()) == false) return false; if (other.getBitRightShift() == null ^ this.getBitRightShift() == null) return false; if (other.getBitRightShift() != null && other.getBitRightShift().equals(this.getBitRightShift()) == false) return false; if (other.getBitMaskLength() == null ^ this.getBitMaskLength() == null) return false; if (other.getBitMaskLength() != null && other.getBitMaskLength().equals(this.getBitMaskLength()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getPidResponseLength() == null) ? 0 : getPidResponseLength().hashCode()); hashCode = prime * hashCode + ((getServiceMode() == null) ? 0 : getServiceMode().hashCode()); hashCode = prime * hashCode + ((getPid() == null) ? 0 : getPid().hashCode()); hashCode = prime * hashCode + ((getScaling() == null) ? 0 : getScaling().hashCode()); hashCode = prime * hashCode + ((getOffset() == null) ? 0 : getOffset().hashCode()); hashCode = prime * hashCode + ((getStartByte() == null) ? 0 : getStartByte().hashCode()); hashCode = prime * hashCode + ((getByteLength() == null) ? 0 : getByteLength().hashCode()); hashCode = prime * hashCode + ((getBitRightShift() == null) ? 0 : getBitRightShift().hashCode()); hashCode = prime * hashCode + ((getBitMaskLength() == null) ? 0 : getBitMaskLength().hashCode()); return hashCode; } @Override public ObdSignal clone() { try { return (ObdSignal) 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.ObdSignalMarshaller.getInstance().marshall(this, protocolMarshaller); } }