
software.amazon.awssdk.services.glue.model.MappingEntry Maven / Gradle / Ivy
/*
* 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.glue.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;
/**
*
* Defines a mapping.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class MappingEntry implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField SOURCE_TABLE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("SourceTable").getter(getter(MappingEntry::sourceTable)).setter(setter(Builder::sourceTable))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SourceTable").build()).build();
private static final SdkField SOURCE_PATH_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("SourcePath").getter(getter(MappingEntry::sourcePath)).setter(setter(Builder::sourcePath))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SourcePath").build()).build();
private static final SdkField SOURCE_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("SourceType").getter(getter(MappingEntry::sourceType)).setter(setter(Builder::sourceType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SourceType").build()).build();
private static final SdkField TARGET_TABLE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("TargetTable").getter(getter(MappingEntry::targetTable)).setter(setter(Builder::targetTable))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TargetTable").build()).build();
private static final SdkField TARGET_PATH_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("TargetPath").getter(getter(MappingEntry::targetPath)).setter(setter(Builder::targetPath))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TargetPath").build()).build();
private static final SdkField TARGET_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("TargetType").getter(getter(MappingEntry::targetType)).setter(setter(Builder::targetType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TargetType").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(SOURCE_TABLE_FIELD,
SOURCE_PATH_FIELD, SOURCE_TYPE_FIELD, TARGET_TABLE_FIELD, TARGET_PATH_FIELD, TARGET_TYPE_FIELD));
private static final long serialVersionUID = 1L;
private final String sourceTable;
private final String sourcePath;
private final String sourceType;
private final String targetTable;
private final String targetPath;
private final String targetType;
private MappingEntry(BuilderImpl builder) {
this.sourceTable = builder.sourceTable;
this.sourcePath = builder.sourcePath;
this.sourceType = builder.sourceType;
this.targetTable = builder.targetTable;
this.targetPath = builder.targetPath;
this.targetType = builder.targetType;
}
/**
*
* The name of the source table.
*
*
* @return The name of the source table.
*/
public final String sourceTable() {
return sourceTable;
}
/**
*
* The source path.
*
*
* @return The source path.
*/
public final String sourcePath() {
return sourcePath;
}
/**
*
* The source type.
*
*
* @return The source type.
*/
public final String sourceType() {
return sourceType;
}
/**
*
* The target table.
*
*
* @return The target table.
*/
public final String targetTable() {
return targetTable;
}
/**
*
* The target path.
*
*
* @return The target path.
*/
public final String targetPath() {
return targetPath;
}
/**
*
* The target type.
*
*
* @return The target type.
*/
public final String targetType() {
return targetType;
}
@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(sourceTable());
hashCode = 31 * hashCode + Objects.hashCode(sourcePath());
hashCode = 31 * hashCode + Objects.hashCode(sourceType());
hashCode = 31 * hashCode + Objects.hashCode(targetTable());
hashCode = 31 * hashCode + Objects.hashCode(targetPath());
hashCode = 31 * hashCode + Objects.hashCode(targetType());
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 MappingEntry)) {
return false;
}
MappingEntry other = (MappingEntry) obj;
return Objects.equals(sourceTable(), other.sourceTable()) && Objects.equals(sourcePath(), other.sourcePath())
&& Objects.equals(sourceType(), other.sourceType()) && Objects.equals(targetTable(), other.targetTable())
&& Objects.equals(targetPath(), other.targetPath()) && Objects.equals(targetType(), other.targetType());
}
/**
* 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("MappingEntry").add("SourceTable", sourceTable()).add("SourcePath", sourcePath())
.add("SourceType", sourceType()).add("TargetTable", targetTable()).add("TargetPath", targetPath())
.add("TargetType", targetType()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "SourceTable":
return Optional.ofNullable(clazz.cast(sourceTable()));
case "SourcePath":
return Optional.ofNullable(clazz.cast(sourcePath()));
case "SourceType":
return Optional.ofNullable(clazz.cast(sourceType()));
case "TargetTable":
return Optional.ofNullable(clazz.cast(targetTable()));
case "TargetPath":
return Optional.ofNullable(clazz.cast(targetPath()));
case "TargetType":
return Optional.ofNullable(clazz.cast(targetType()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function
© 2015 - 2025 Weber Informatics LLC | Privacy Policy