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

software.amazon.awssdk.services.iotfleetwise.model.CanSignal 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 a single controller area network (CAN) signal and the messages it receives and transmits. *

*/ @Generated("software.amazon.awssdk:codegen") public final class CanSignal implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField MESSAGE_ID_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("messageId").getter(getter(CanSignal::messageId)).setter(setter(Builder::messageId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("messageId").build()).build(); private static final SdkField IS_BIG_ENDIAN_FIELD = SdkField. builder(MarshallingType.BOOLEAN) .memberName("isBigEndian").getter(getter(CanSignal::isBigEndian)).setter(setter(Builder::isBigEndian)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("isBigEndian").build()).build(); private static final SdkField IS_SIGNED_FIELD = SdkField. builder(MarshallingType.BOOLEAN) .memberName("isSigned").getter(getter(CanSignal::isSigned)).setter(setter(Builder::isSigned)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("isSigned").build()).build(); private static final SdkField START_BIT_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("startBit").getter(getter(CanSignal::startBit)).setter(setter(Builder::startBit)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("startBit").build()).build(); private static final SdkField OFFSET_FIELD = SdkField. builder(MarshallingType.DOUBLE).memberName("offset") .getter(getter(CanSignal::offset)).setter(setter(Builder::offset)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("offset").build()).build(); private static final SdkField FACTOR_FIELD = SdkField. builder(MarshallingType.DOUBLE).memberName("factor") .getter(getter(CanSignal::factor)).setter(setter(Builder::factor)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("factor").build()).build(); private static final SdkField LENGTH_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("length").getter(getter(CanSignal::length)).setter(setter(Builder::length)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("length").build()).build(); private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("name") .getter(getter(CanSignal::name)).setter(setter(Builder::name)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("name").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(MESSAGE_ID_FIELD, IS_BIG_ENDIAN_FIELD, IS_SIGNED_FIELD, START_BIT_FIELD, OFFSET_FIELD, FACTOR_FIELD, LENGTH_FIELD, NAME_FIELD)); private static final long serialVersionUID = 1L; private final Integer messageId; private final Boolean isBigEndian; private final Boolean isSigned; private final Integer startBit; private final Double offset; private final Double factor; private final Integer length; private final String name; private CanSignal(BuilderImpl builder) { this.messageId = builder.messageId; this.isBigEndian = builder.isBigEndian; this.isSigned = builder.isSigned; this.startBit = builder.startBit; this.offset = builder.offset; this.factor = builder.factor; this.length = builder.length; this.name = builder.name; } /** *

* The ID of the message. *

* * @return The ID of the message. */ public final Integer messageId() { return messageId; } /** *

* Whether the byte ordering of a CAN message is big-endian. *

* * @return Whether the byte ordering of a CAN message is big-endian. */ public final Boolean isBigEndian() { return isBigEndian; } /** *

* Whether the message data is specified as a signed value. *

* * @return Whether the message data is specified as a signed value. */ public final Boolean isSigned() { return isSigned; } /** *

* Indicates the beginning of the CAN message. *

* * @return Indicates the beginning of the CAN message. */ public final Integer startBit() { return startBit; } /** *

* Indicates where data appears in the CAN message. *

* * @return Indicates where data appears in the CAN message. */ public final Double offset() { return offset; } /** *

* A multiplier used to decode the CAN message. *

* * @return A multiplier used to decode the CAN message. */ public final Double factor() { return factor; } /** *

* How many bytes of data are in the message. *

* * @return How many bytes of data are in the message. */ public final Integer length() { return length; } /** *

* The name of the signal. *

* * @return The name of the signal. */ public final String name() { return name; } @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(messageId()); hashCode = 31 * hashCode + Objects.hashCode(isBigEndian()); hashCode = 31 * hashCode + Objects.hashCode(isSigned()); hashCode = 31 * hashCode + Objects.hashCode(startBit()); hashCode = 31 * hashCode + Objects.hashCode(offset()); hashCode = 31 * hashCode + Objects.hashCode(factor()); hashCode = 31 * hashCode + Objects.hashCode(length()); hashCode = 31 * hashCode + Objects.hashCode(name()); 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 CanSignal)) { return false; } CanSignal other = (CanSignal) obj; return Objects.equals(messageId(), other.messageId()) && Objects.equals(isBigEndian(), other.isBigEndian()) && Objects.equals(isSigned(), other.isSigned()) && Objects.equals(startBit(), other.startBit()) && Objects.equals(offset(), other.offset()) && Objects.equals(factor(), other.factor()) && Objects.equals(length(), other.length()) && Objects.equals(name(), other.name()); } /** * 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("CanSignal").add("MessageId", messageId()).add("IsBigEndian", isBigEndian()) .add("IsSigned", isSigned()).add("StartBit", startBit()).add("Offset", offset()).add("Factor", factor()) .add("Length", length()).add("Name", name()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "messageId": return Optional.ofNullable(clazz.cast(messageId())); case "isBigEndian": return Optional.ofNullable(clazz.cast(isBigEndian())); case "isSigned": return Optional.ofNullable(clazz.cast(isSigned())); case "startBit": return Optional.ofNullable(clazz.cast(startBit())); case "offset": return Optional.ofNullable(clazz.cast(offset())); case "factor": return Optional.ofNullable(clazz.cast(factor())); case "length": return Optional.ofNullable(clazz.cast(length())); case "name": return Optional.ofNullable(clazz.cast(name())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((CanSignal) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The ID of the message. *

* * @param messageId * The ID of the message. * @return Returns a reference to this object so that method calls can be chained together. */ Builder messageId(Integer messageId); /** *

* Whether the byte ordering of a CAN message is big-endian. *

* * @param isBigEndian * Whether the byte ordering of a CAN message is big-endian. * @return Returns a reference to this object so that method calls can be chained together. */ Builder isBigEndian(Boolean isBigEndian); /** *

* Whether the message data is specified as a signed value. *

* * @param isSigned * Whether the message data is specified as a signed value. * @return Returns a reference to this object so that method calls can be chained together. */ Builder isSigned(Boolean isSigned); /** *

* Indicates the beginning of the CAN message. *

* * @param startBit * Indicates the beginning of the CAN message. * @return Returns a reference to this object so that method calls can be chained together. */ Builder startBit(Integer startBit); /** *

* Indicates where data appears in the CAN message. *

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

* A multiplier used to decode the CAN message. *

* * @param factor * A multiplier used to decode the CAN message. * @return Returns a reference to this object so that method calls can be chained together. */ Builder factor(Double factor); /** *

* How many bytes of data are in the message. *

* * @param length * How many bytes of data are in the message. * @return Returns a reference to this object so that method calls can be chained together. */ Builder length(Integer length); /** *

* The name of the signal. *

* * @param name * The name of the signal. * @return Returns a reference to this object so that method calls can be chained together. */ Builder name(String name); } static final class BuilderImpl implements Builder { private Integer messageId; private Boolean isBigEndian; private Boolean isSigned; private Integer startBit; private Double offset; private Double factor; private Integer length; private String name; private BuilderImpl() { } private BuilderImpl(CanSignal model) { messageId(model.messageId); isBigEndian(model.isBigEndian); isSigned(model.isSigned); startBit(model.startBit); offset(model.offset); factor(model.factor); length(model.length); name(model.name); } public final Integer getMessageId() { return messageId; } public final void setMessageId(Integer messageId) { this.messageId = messageId; } @Override public final Builder messageId(Integer messageId) { this.messageId = messageId; return this; } public final Boolean getIsBigEndian() { return isBigEndian; } public final void setIsBigEndian(Boolean isBigEndian) { this.isBigEndian = isBigEndian; } @Override public final Builder isBigEndian(Boolean isBigEndian) { this.isBigEndian = isBigEndian; return this; } public final Boolean getIsSigned() { return isSigned; } public final void setIsSigned(Boolean isSigned) { this.isSigned = isSigned; } @Override public final Builder isSigned(Boolean isSigned) { this.isSigned = isSigned; return this; } public final Integer getStartBit() { return startBit; } public final void setStartBit(Integer startBit) { this.startBit = startBit; } @Override public final Builder startBit(Integer startBit) { this.startBit = startBit; 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 Double getFactor() { return factor; } public final void setFactor(Double factor) { this.factor = factor; } @Override public final Builder factor(Double factor) { this.factor = factor; return this; } public final Integer getLength() { return length; } public final void setLength(Integer length) { this.length = length; } @Override public final Builder length(Integer length) { this.length = length; return this; } public final String getName() { return name; } public final void setName(String name) { this.name = name; } @Override public final Builder name(String name) { this.name = name; return this; } @Override public CanSignal build() { return new CanSignal(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy