All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.iotfleetwise.model.ObdSignal Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Io T Fleet Wise module holds the client classes that are used for communicating with Io T Fleet Wise.

There is a newer version: 2.29.39
Show newest version
/*
 * 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 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 getter(Function g) { return obj -> g.apply((ObdSignal) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* 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. */ Builder pidResponseLength(Integer pidResponseLength); /** *

* 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. */ Builder serviceMode(Integer serviceMode); /** *

* 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. */ Builder pid(Integer pid); /** *

* 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. */ Builder scaling(Double scaling); /** *

* Indicates where data appears in the message. *

* * @param offset * Indicates where data appears in the message. * @return Returns a reference to this object so that method calls can be chained together. */ Builder offset(Double offset); /** *

* 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. */ Builder startByte(Integer startByte); /** *

* 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. */ Builder byteLength(Integer byteLength); /** *

* 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. */ Builder bitRightShift(Integer bitRightShift); /** *

* 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. */ Builder bitMaskLength(Integer bitMaskLength); } static final class BuilderImpl implements Builder { private Integer pidResponseLength; private Integer serviceMode; private Integer pid; private Double scaling; private Double offset; private Integer startByte; private Integer byteLength; private Integer bitRightShift; private Integer bitMaskLength; private BuilderImpl() { } private BuilderImpl(ObdSignal model) { pidResponseLength(model.pidResponseLength); serviceMode(model.serviceMode); pid(model.pid); scaling(model.scaling); offset(model.offset); startByte(model.startByte); byteLength(model.byteLength); bitRightShift(model.bitRightShift); bitMaskLength(model.bitMaskLength); } public final Integer getPidResponseLength() { return pidResponseLength; } public final void setPidResponseLength(Integer pidResponseLength) { this.pidResponseLength = pidResponseLength; } @Override public final Builder pidResponseLength(Integer pidResponseLength) { this.pidResponseLength = pidResponseLength; return this; } public final Integer getServiceMode() { return serviceMode; } public final void setServiceMode(Integer serviceMode) { this.serviceMode = serviceMode; } @Override public final Builder serviceMode(Integer serviceMode) { this.serviceMode = serviceMode; return this; } public final Integer getPid() { return pid; } public final void setPid(Integer pid) { this.pid = pid; } @Override public final Builder pid(Integer pid) { this.pid = pid; return this; } public final Double getScaling() { return scaling; } public final void setScaling(Double scaling) { this.scaling = scaling; } @Override public final Builder scaling(Double scaling) { this.scaling = scaling; return this; } public final Double getOffset() { return offset; } public final void setOffset(Double offset) { this.offset = offset; } @Override public final Builder offset(Double offset) { this.offset = offset; return this; } public final Integer getStartByte() { return startByte; } public final void setStartByte(Integer startByte) { this.startByte = startByte; } @Override public final Builder startByte(Integer startByte) { this.startByte = startByte; return this; } public final Integer getByteLength() { return byteLength; } public final void setByteLength(Integer byteLength) { this.byteLength = byteLength; } @Override public final Builder byteLength(Integer byteLength) { this.byteLength = byteLength; return this; } public final Integer getBitRightShift() { return bitRightShift; } public final void setBitRightShift(Integer bitRightShift) { this.bitRightShift = bitRightShift; } @Override public final Builder bitRightShift(Integer bitRightShift) { this.bitRightShift = bitRightShift; return this; } public final Integer getBitMaskLength() { return bitMaskLength; } public final void setBitMaskLength(Integer bitMaskLength) { this.bitMaskLength = bitMaskLength; } @Override public final Builder bitMaskLength(Integer bitMaskLength) { this.bitMaskLength = bitMaskLength; return this; } @Override public ObdSignal build() { return new ObdSignal(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy