software.amazon.awssdk.services.iotfleetwise.model.ObdSignal Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of iotfleetwise Show documentation
Show all versions of iotfleetwise Show documentation
The AWS Java SDK for Io T Fleet Wise module holds the client classes that are used for
communicating with Io T Fleet Wise.
/*
* Copyright 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 software.amazon.awssdk.services.iotfleetwise.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* Information about signal messages using the on-board diagnostics (OBD) II protocol in a vehicle.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class ObdSignal implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField PID_RESPONSE_LENGTH_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("pidResponseLength").getter(getter(ObdSignal::pidResponseLength))
.setter(setter(Builder::pidResponseLength))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("pidResponseLength").build()).build();
private static final SdkField SERVICE_MODE_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("serviceMode").getter(getter(ObdSignal::serviceMode)).setter(setter(Builder::serviceMode))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("serviceMode").build()).build();
private static final SdkField PID_FIELD = SdkField. builder(MarshallingType.INTEGER).memberName("pid")
.getter(getter(ObdSignal::pid)).setter(setter(Builder::pid))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("pid").build()).build();
private static final SdkField SCALING_FIELD = SdkField. builder(MarshallingType.DOUBLE).memberName("scaling")
.getter(getter(ObdSignal::scaling)).setter(setter(Builder::scaling))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("scaling").build()).build();
private static final SdkField OFFSET_FIELD = SdkField. builder(MarshallingType.DOUBLE).memberName("offset")
.getter(getter(ObdSignal::offset)).setter(setter(Builder::offset))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("offset").build()).build();
private static final SdkField START_BYTE_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("startByte").getter(getter(ObdSignal::startByte)).setter(setter(Builder::startByte))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("startByte").build()).build();
private static final SdkField BYTE_LENGTH_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("byteLength").getter(getter(ObdSignal::byteLength)).setter(setter(Builder::byteLength))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("byteLength").build()).build();
private static final SdkField BIT_RIGHT_SHIFT_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("bitRightShift").getter(getter(ObdSignal::bitRightShift)).setter(setter(Builder::bitRightShift))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("bitRightShift").build()).build();
private static final SdkField BIT_MASK_LENGTH_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("bitMaskLength").getter(getter(ObdSignal::bitMaskLength)).setter(setter(Builder::bitMaskLength))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("bitMaskLength").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(PID_RESPONSE_LENGTH_FIELD,
SERVICE_MODE_FIELD, PID_FIELD, SCALING_FIELD, OFFSET_FIELD, START_BYTE_FIELD, BYTE_LENGTH_FIELD,
BIT_RIGHT_SHIFT_FIELD, BIT_MASK_LENGTH_FIELD));
private static final long serialVersionUID = 1L;
private final Integer pidResponseLength;
private final Integer serviceMode;
private final Integer pid;
private final Double scaling;
private final Double offset;
private final Integer startByte;
private final Integer byteLength;
private final Integer bitRightShift;
private final Integer bitMaskLength;
private ObdSignal(BuilderImpl builder) {
this.pidResponseLength = builder.pidResponseLength;
this.serviceMode = builder.serviceMode;
this.pid = builder.pid;
this.scaling = builder.scaling;
this.offset = builder.offset;
this.startByte = builder.startByte;
this.byteLength = builder.byteLength;
this.bitRightShift = builder.bitRightShift;
this.bitMaskLength = builder.bitMaskLength;
}
/**
*
* The length of the requested data.
*
*
* @return The length of the requested data.
*/
public final Integer pidResponseLength() {
return pidResponseLength;
}
/**
*
* The mode of operation (diagnostic service) in a message.
*
*
* @return The mode of operation (diagnostic service) in a message.
*/
public final Integer serviceMode() {
return serviceMode;
}
/**
*
* 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 final Integer pid() {
return pid;
}
/**
*
* A multiplier used to decode the message.
*
*
* @return A multiplier used to decode the message.
*/
public final Double scaling() {
return scaling;
}
/**
*
* Indicates where data appears in the message.
*
*
* @return Indicates where data appears in the message.
*/
public final Double offset() {
return offset;
}
/**
*
* Indicates the beginning of the message.
*
*
* @return Indicates the beginning of the message.
*/
public final Integer startByte() {
return startByte;
}
/**
*
* The length of a message.
*
*
* @return The length of a message.
*/
public final Integer byteLength() {
return byteLength;
}
/**
*
* The number of positions to shift bits in the message.
*
*
* @return The number of positions to shift bits in the message.
*/
public final Integer bitRightShift() {
return bitRightShift;
}
/**
*
* The number of bits to mask in a message.
*
*
* @return The number of bits to mask in a message.
*/
public final Integer bitMaskLength() {
return bitMaskLength;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(pidResponseLength());
hashCode = 31 * hashCode + Objects.hashCode(serviceMode());
hashCode = 31 * hashCode + Objects.hashCode(pid());
hashCode = 31 * hashCode + Objects.hashCode(scaling());
hashCode = 31 * hashCode + Objects.hashCode(offset());
hashCode = 31 * hashCode + Objects.hashCode(startByte());
hashCode = 31 * hashCode + Objects.hashCode(byteLength());
hashCode = 31 * hashCode + Objects.hashCode(bitRightShift());
hashCode = 31 * hashCode + Objects.hashCode(bitMaskLength());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof ObdSignal)) {
return false;
}
ObdSignal other = (ObdSignal) obj;
return Objects.equals(pidResponseLength(), other.pidResponseLength())
&& Objects.equals(serviceMode(), other.serviceMode()) && Objects.equals(pid(), other.pid())
&& Objects.equals(scaling(), other.scaling()) && Objects.equals(offset(), other.offset())
&& Objects.equals(startByte(), other.startByte()) && Objects.equals(byteLength(), other.byteLength())
&& Objects.equals(bitRightShift(), other.bitRightShift())
&& Objects.equals(bitMaskLength(), other.bitMaskLength());
}
/**
* 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.
*/
@Override
public final String toString() {
return ToString.builder("ObdSignal").add("PidResponseLength", pidResponseLength()).add("ServiceMode", serviceMode())
.add("Pid", pid()).add("Scaling", scaling()).add("Offset", offset()).add("StartByte", startByte())
.add("ByteLength", byteLength()).add("BitRightShift", bitRightShift()).add("BitMaskLength", bitMaskLength())
.build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "pidResponseLength":
return Optional.ofNullable(clazz.cast(pidResponseLength()));
case "serviceMode":
return Optional.ofNullable(clazz.cast(serviceMode()));
case "pid":
return Optional.ofNullable(clazz.cast(pid()));
case "scaling":
return Optional.ofNullable(clazz.cast(scaling()));
case "offset":
return Optional.ofNullable(clazz.cast(offset()));
case "startByte":
return Optional.ofNullable(clazz.cast(startByte()));
case "byteLength":
return Optional.ofNullable(clazz.cast(byteLength()));
case "bitRightShift":
return Optional.ofNullable(clazz.cast(bitRightShift()));
case "bitMaskLength":
return Optional.ofNullable(clazz.cast(bitMaskLength()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function
© 2015 - 2025 Weber Informatics LLC | Privacy Policy