software.amazon.awssdk.services.sagemakergeospatial.model.MapMatchingConfig Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sagemakergeospatial Show documentation
Show all versions of sagemakergeospatial Show documentation
The AWS Java SDK for Sage Maker Geospatial module holds the client classes that are used for
communicating with Sage Maker Geospatial.
/*
* 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.sagemakergeospatial.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
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;
/**
*
* The input structure for Map Matching operation type.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class MapMatchingConfig implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField ID_ATTRIBUTE_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("IdAttributeName").getter(getter(MapMatchingConfig::idAttributeName))
.setter(setter(Builder::idAttributeName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IdAttributeName").build()).build();
private static final SdkField TIMESTAMP_ATTRIBUTE_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("TimestampAttributeName").getter(getter(MapMatchingConfig::timestampAttributeName))
.setter(setter(Builder::timestampAttributeName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TimestampAttributeName").build())
.build();
private static final SdkField X_ATTRIBUTE_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("XAttributeName").getter(getter(MapMatchingConfig::xAttributeName))
.setter(setter(Builder::xAttributeName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("XAttributeName").build()).build();
private static final SdkField Y_ATTRIBUTE_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("YAttributeName").getter(getter(MapMatchingConfig::yAttributeName))
.setter(setter(Builder::yAttributeName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("YAttributeName").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ID_ATTRIBUTE_NAME_FIELD,
TIMESTAMP_ATTRIBUTE_NAME_FIELD, X_ATTRIBUTE_NAME_FIELD, Y_ATTRIBUTE_NAME_FIELD));
private static final Map> SDK_NAME_TO_FIELD = memberNameToFieldInitializer();
private static final long serialVersionUID = 1L;
private final String idAttributeName;
private final String timestampAttributeName;
private final String xAttributeName;
private final String yAttributeName;
private MapMatchingConfig(BuilderImpl builder) {
this.idAttributeName = builder.idAttributeName;
this.timestampAttributeName = builder.timestampAttributeName;
this.xAttributeName = builder.xAttributeName;
this.yAttributeName = builder.yAttributeName;
}
/**
*
* The field name for the data that describes the identifier representing a collection of GPS points belonging to an
* individual trace.
*
*
* @return The field name for the data that describes the identifier representing a collection of GPS points
* belonging to an individual trace.
*/
public final String idAttributeName() {
return idAttributeName;
}
/**
*
* The name of the timestamp attribute.
*
*
* @return The name of the timestamp attribute.
*/
public final String timestampAttributeName() {
return timestampAttributeName;
}
/**
*
* The name of the X-attribute
*
*
* @return The name of the X-attribute
*/
public final String xAttributeName() {
return xAttributeName;
}
/**
*
* The name of the Y-attribute
*
*
* @return The name of the Y-attribute
*/
public final String yAttributeName() {
return yAttributeName;
}
@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(idAttributeName());
hashCode = 31 * hashCode + Objects.hashCode(timestampAttributeName());
hashCode = 31 * hashCode + Objects.hashCode(xAttributeName());
hashCode = 31 * hashCode + Objects.hashCode(yAttributeName());
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 MapMatchingConfig)) {
return false;
}
MapMatchingConfig other = (MapMatchingConfig) obj;
return Objects.equals(idAttributeName(), other.idAttributeName())
&& Objects.equals(timestampAttributeName(), other.timestampAttributeName())
&& Objects.equals(xAttributeName(), other.xAttributeName())
&& Objects.equals(yAttributeName(), other.yAttributeName());
}
/**
* 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("MapMatchingConfig").add("IdAttributeName", idAttributeName())
.add("TimestampAttributeName", timestampAttributeName()).add("XAttributeName", xAttributeName())
.add("YAttributeName", yAttributeName()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "IdAttributeName":
return Optional.ofNullable(clazz.cast(idAttributeName()));
case "TimestampAttributeName":
return Optional.ofNullable(clazz.cast(timestampAttributeName()));
case "XAttributeName":
return Optional.ofNullable(clazz.cast(xAttributeName()));
case "YAttributeName":
return Optional.ofNullable(clazz.cast(yAttributeName()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
@Override
public final Map> sdkFieldNameToField() {
return SDK_NAME_TO_FIELD;
}
private static Map> memberNameToFieldInitializer() {
Map> map = new HashMap<>();
map.put("IdAttributeName", ID_ATTRIBUTE_NAME_FIELD);
map.put("TimestampAttributeName", TIMESTAMP_ATTRIBUTE_NAME_FIELD);
map.put("XAttributeName", X_ATTRIBUTE_NAME_FIELD);
map.put("YAttributeName", Y_ATTRIBUTE_NAME_FIELD);
return Collections.unmodifiableMap(map);
}
private static Function
© 2015 - 2024 Weber Informatics LLC | Privacy Policy