software.amazon.awssdk.services.iotfleetwise.model.ObdInterface 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;
/**
*
* A network interface that specifies the On-board diagnostic (OBD) II network protocol.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class ObdInterface implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("name")
.getter(getter(ObdInterface::name)).setter(setter(Builder::name))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("name").build()).build();
private static final SdkField REQUEST_MESSAGE_ID_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("requestMessageId").getter(getter(ObdInterface::requestMessageId))
.setter(setter(Builder::requestMessageId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("requestMessageId").build()).build();
private static final SdkField OBD_STANDARD_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("obdStandard").getter(getter(ObdInterface::obdStandard)).setter(setter(Builder::obdStandard))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("obdStandard").build()).build();
private static final SdkField PID_REQUEST_INTERVAL_SECONDS_FIELD = SdkField
. builder(MarshallingType.INTEGER).memberName("pidRequestIntervalSeconds")
.getter(getter(ObdInterface::pidRequestIntervalSeconds)).setter(setter(Builder::pidRequestIntervalSeconds))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("pidRequestIntervalSeconds").build())
.build();
private static final SdkField DTC_REQUEST_INTERVAL_SECONDS_FIELD = SdkField
. builder(MarshallingType.INTEGER).memberName("dtcRequestIntervalSeconds")
.getter(getter(ObdInterface::dtcRequestIntervalSeconds)).setter(setter(Builder::dtcRequestIntervalSeconds))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("dtcRequestIntervalSeconds").build())
.build();
private static final SdkField USE_EXTENDED_IDS_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("useExtendedIds").getter(getter(ObdInterface::useExtendedIds)).setter(setter(Builder::useExtendedIds))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("useExtendedIds").build()).build();
private static final SdkField HAS_TRANSMISSION_ECU_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("hasTransmissionEcu").getter(getter(ObdInterface::hasTransmissionEcu))
.setter(setter(Builder::hasTransmissionEcu))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("hasTransmissionEcu").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(NAME_FIELD,
REQUEST_MESSAGE_ID_FIELD, OBD_STANDARD_FIELD, PID_REQUEST_INTERVAL_SECONDS_FIELD, DTC_REQUEST_INTERVAL_SECONDS_FIELD,
USE_EXTENDED_IDS_FIELD, HAS_TRANSMISSION_ECU_FIELD));
private static final long serialVersionUID = 1L;
private final String name;
private final Integer requestMessageId;
private final String obdStandard;
private final Integer pidRequestIntervalSeconds;
private final Integer dtcRequestIntervalSeconds;
private final Boolean useExtendedIds;
private final Boolean hasTransmissionEcu;
private ObdInterface(BuilderImpl builder) {
this.name = builder.name;
this.requestMessageId = builder.requestMessageId;
this.obdStandard = builder.obdStandard;
this.pidRequestIntervalSeconds = builder.pidRequestIntervalSeconds;
this.dtcRequestIntervalSeconds = builder.dtcRequestIntervalSeconds;
this.useExtendedIds = builder.useExtendedIds;
this.hasTransmissionEcu = builder.hasTransmissionEcu;
}
/**
*
* The name of the interface.
*
*
* @return The name of the interface.
*/
public final String name() {
return name;
}
/**
*
* The ID of the message requesting vehicle data.
*
*
* @return The ID of the message requesting vehicle data.
*/
public final Integer requestMessageId() {
return requestMessageId;
}
/**
*
* The standard OBD II PID.
*
*
* @return The standard OBD II PID.
*/
public final String obdStandard() {
return obdStandard;
}
/**
*
* The maximum number message requests per second.
*
*
* @return The maximum number message requests per second.
*/
public final Integer pidRequestIntervalSeconds() {
return pidRequestIntervalSeconds;
}
/**
*
* The maximum number message requests per diagnostic trouble code per second.
*
*
* @return The maximum number message requests per diagnostic trouble code per second.
*/
public final Integer dtcRequestIntervalSeconds() {
return dtcRequestIntervalSeconds;
}
/**
*
* Whether to use extended IDs in the message.
*
*
* @return Whether to use extended IDs in the message.
*/
public final Boolean useExtendedIds() {
return useExtendedIds;
}
/**
*
* Whether the vehicle has a transmission control module (TCM).
*
*
* @return Whether the vehicle has a transmission control module (TCM).
*/
public final Boolean hasTransmissionEcu() {
return hasTransmissionEcu;
}
@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(name());
hashCode = 31 * hashCode + Objects.hashCode(requestMessageId());
hashCode = 31 * hashCode + Objects.hashCode(obdStandard());
hashCode = 31 * hashCode + Objects.hashCode(pidRequestIntervalSeconds());
hashCode = 31 * hashCode + Objects.hashCode(dtcRequestIntervalSeconds());
hashCode = 31 * hashCode + Objects.hashCode(useExtendedIds());
hashCode = 31 * hashCode + Objects.hashCode(hasTransmissionEcu());
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 ObdInterface)) {
return false;
}
ObdInterface other = (ObdInterface) obj;
return Objects.equals(name(), other.name()) && Objects.equals(requestMessageId(), other.requestMessageId())
&& Objects.equals(obdStandard(), other.obdStandard())
&& Objects.equals(pidRequestIntervalSeconds(), other.pidRequestIntervalSeconds())
&& Objects.equals(dtcRequestIntervalSeconds(), other.dtcRequestIntervalSeconds())
&& Objects.equals(useExtendedIds(), other.useExtendedIds())
&& Objects.equals(hasTransmissionEcu(), other.hasTransmissionEcu());
}
/**
* 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("ObdInterface").add("Name", name()).add("RequestMessageId", requestMessageId())
.add("ObdStandard", obdStandard()).add("PidRequestIntervalSeconds", pidRequestIntervalSeconds())
.add("DtcRequestIntervalSeconds", dtcRequestIntervalSeconds()).add("UseExtendedIds", useExtendedIds())
.add("HasTransmissionEcu", hasTransmissionEcu()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "name":
return Optional.ofNullable(clazz.cast(name()));
case "requestMessageId":
return Optional.ofNullable(clazz.cast(requestMessageId()));
case "obdStandard":
return Optional.ofNullable(clazz.cast(obdStandard()));
case "pidRequestIntervalSeconds":
return Optional.ofNullable(clazz.cast(pidRequestIntervalSeconds()));
case "dtcRequestIntervalSeconds":
return Optional.ofNullable(clazz.cast(dtcRequestIntervalSeconds()));
case "useExtendedIds":
return Optional.ofNullable(clazz.cast(useExtendedIds()));
case "hasTransmissionEcu":
return Optional.ofNullable(clazz.cast(hasTransmissionEcu()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function
© 2015 - 2025 Weber Informatics LLC | Privacy Policy