software.amazon.awssdk.services.iotfleetwise.model.CustomProperty Maven / Gradle / Ivy
Show all versions of iotfleetwise Show documentation
/*
* 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;
/**
*
* Represents a member of the complex data structure. The data type of the property can be either primitive or another
* struct
.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class CustomProperty implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField FULLY_QUALIFIED_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("fullyQualifiedName").getter(getter(CustomProperty::fullyQualifiedName))
.setter(setter(Builder::fullyQualifiedName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("fullyQualifiedName").build())
.build();
private static final SdkField DATA_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("dataType").getter(getter(CustomProperty::dataTypeAsString)).setter(setter(Builder::dataType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("dataType").build()).build();
private static final SdkField DATA_ENCODING_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("dataEncoding").getter(getter(CustomProperty::dataEncodingAsString))
.setter(setter(Builder::dataEncoding))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("dataEncoding").build()).build();
private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("description").getter(getter(CustomProperty::description)).setter(setter(Builder::description))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("description").build()).build();
private static final SdkField DEPRECATION_MESSAGE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("deprecationMessage").getter(getter(CustomProperty::deprecationMessage))
.setter(setter(Builder::deprecationMessage))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("deprecationMessage").build())
.build();
private static final SdkField COMMENT_FIELD = SdkField. builder(MarshallingType.STRING).memberName("comment")
.getter(getter(CustomProperty::comment)).setter(setter(Builder::comment))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("comment").build()).build();
private static final SdkField STRUCT_FULLY_QUALIFIED_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("structFullyQualifiedName").getter(getter(CustomProperty::structFullyQualifiedName))
.setter(setter(Builder::structFullyQualifiedName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("structFullyQualifiedName").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(FULLY_QUALIFIED_NAME_FIELD,
DATA_TYPE_FIELD, DATA_ENCODING_FIELD, DESCRIPTION_FIELD, DEPRECATION_MESSAGE_FIELD, COMMENT_FIELD,
STRUCT_FULLY_QUALIFIED_NAME_FIELD));
private static final long serialVersionUID = 1L;
private final String fullyQualifiedName;
private final String dataType;
private final String dataEncoding;
private final String description;
private final String deprecationMessage;
private final String comment;
private final String structFullyQualifiedName;
private CustomProperty(BuilderImpl builder) {
this.fullyQualifiedName = builder.fullyQualifiedName;
this.dataType = builder.dataType;
this.dataEncoding = builder.dataEncoding;
this.description = builder.description;
this.deprecationMessage = builder.deprecationMessage;
this.comment = builder.comment;
this.structFullyQualifiedName = builder.structFullyQualifiedName;
}
/**
*
* The fully qualified name of the custom property. For example, the fully qualified name of a custom property might
* be ComplexDataTypes.VehicleDataTypes.SVMCamera.FPS
.
*
*
* @return The fully qualified name of the custom property. For example, the fully qualified name of a custom
* property might be ComplexDataTypes.VehicleDataTypes.SVMCamera.FPS
.
*/
public final String fullyQualifiedName() {
return fullyQualifiedName;
}
/**
*
* The data type for the custom property.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #dataType} will
* return {@link NodeDataType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #dataTypeAsString}.
*
*
* @return The data type for the custom property.
* @see NodeDataType
*/
public final NodeDataType dataType() {
return NodeDataType.fromValue(dataType);
}
/**
*
* The data type for the custom property.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #dataType} will
* return {@link NodeDataType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #dataTypeAsString}.
*
*
* @return The data type for the custom property.
* @see NodeDataType
*/
public final String dataTypeAsString() {
return dataType;
}
/**
*
* Indicates whether the property is binary data.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #dataEncoding} will
* return {@link NodeDataEncoding#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #dataEncodingAsString}.
*
*
* @return Indicates whether the property is binary data.
* @see NodeDataEncoding
*/
public final NodeDataEncoding dataEncoding() {
return NodeDataEncoding.fromValue(dataEncoding);
}
/**
*
* Indicates whether the property is binary data.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #dataEncoding} will
* return {@link NodeDataEncoding#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #dataEncodingAsString}.
*
*
* @return Indicates whether the property is binary data.
* @see NodeDataEncoding
*/
public final String dataEncodingAsString() {
return dataEncoding;
}
/**
*
* A brief description of the custom property.
*
*
* @return A brief description of the custom property.
*/
public final String description() {
return description;
}
/**
*
* The deprecation message for the node or the branch that was moved or deleted.
*
*
* @return The deprecation message for the node or the branch that was moved or deleted.
*/
public final String deprecationMessage() {
return deprecationMessage;
}
/**
*
* A comment in addition to the description.
*
*
* @return A comment in addition to the description.
*/
public final String comment() {
return comment;
}
/**
*
* The fully qualified name of the struct node for the custom property if the data type of the custom property is
* Struct
or StructArray
.
*
*
* @return The fully qualified name of the struct node for the custom property if the data type of the custom
* property is Struct
or StructArray
.
*/
public final String structFullyQualifiedName() {
return structFullyQualifiedName;
}
@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(fullyQualifiedName());
hashCode = 31 * hashCode + Objects.hashCode(dataTypeAsString());
hashCode = 31 * hashCode + Objects.hashCode(dataEncodingAsString());
hashCode = 31 * hashCode + Objects.hashCode(description());
hashCode = 31 * hashCode + Objects.hashCode(deprecationMessage());
hashCode = 31 * hashCode + Objects.hashCode(comment());
hashCode = 31 * hashCode + Objects.hashCode(structFullyQualifiedName());
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 CustomProperty)) {
return false;
}
CustomProperty other = (CustomProperty) obj;
return Objects.equals(fullyQualifiedName(), other.fullyQualifiedName())
&& Objects.equals(dataTypeAsString(), other.dataTypeAsString())
&& Objects.equals(dataEncodingAsString(), other.dataEncodingAsString())
&& Objects.equals(description(), other.description())
&& Objects.equals(deprecationMessage(), other.deprecationMessage()) && Objects.equals(comment(), other.comment())
&& Objects.equals(structFullyQualifiedName(), other.structFullyQualifiedName());
}
/**
* 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("CustomProperty").add("FullyQualifiedName", fullyQualifiedName())
.add("DataType", dataTypeAsString()).add("DataEncoding", dataEncodingAsString())
.add("Description", description()).add("DeprecationMessage", deprecationMessage()).add("Comment", comment())
.add("StructFullyQualifiedName", structFullyQualifiedName()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "fullyQualifiedName":
return Optional.ofNullable(clazz.cast(fullyQualifiedName()));
case "dataType":
return Optional.ofNullable(clazz.cast(dataTypeAsString()));
case "dataEncoding":
return Optional.ofNullable(clazz.cast(dataEncodingAsString()));
case "description":
return Optional.ofNullable(clazz.cast(description()));
case "deprecationMessage":
return Optional.ofNullable(clazz.cast(deprecationMessage()));
case "comment":
return Optional.ofNullable(clazz.cast(comment()));
case "structFullyQualifiedName":
return Optional.ofNullable(clazz.cast(structFullyQualifiedName()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function