software.amazon.awssdk.services.entityresolution.model.SchemaMappingSummary 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.entityresolution.model;
import java.io.Serializable;
import java.time.Instant;
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;
/**
*
* An object containing SchemaName
, SchemaArn
, CreatedAt
, and
* UpdatedAt
.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class SchemaMappingSummary implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField CREATED_AT_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("createdAt").getter(getter(SchemaMappingSummary::createdAt)).setter(setter(Builder::createdAt))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("createdAt").build()).build();
private static final SdkField HAS_WORKFLOWS_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("hasWorkflows").getter(getter(SchemaMappingSummary::hasWorkflows)).setter(setter(Builder::hasWorkflows))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("hasWorkflows").build()).build();
private static final SdkField SCHEMA_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("schemaArn").getter(getter(SchemaMappingSummary::schemaArn)).setter(setter(Builder::schemaArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("schemaArn").build()).build();
private static final SdkField SCHEMA_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("schemaName").getter(getter(SchemaMappingSummary::schemaName)).setter(setter(Builder::schemaName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("schemaName").build()).build();
private static final SdkField UPDATED_AT_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("updatedAt").getter(getter(SchemaMappingSummary::updatedAt)).setter(setter(Builder::updatedAt))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("updatedAt").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CREATED_AT_FIELD,
HAS_WORKFLOWS_FIELD, SCHEMA_ARN_FIELD, SCHEMA_NAME_FIELD, UPDATED_AT_FIELD));
private static final Map> SDK_NAME_TO_FIELD = memberNameToFieldInitializer();
private static final long serialVersionUID = 1L;
private final Instant createdAt;
private final Boolean hasWorkflows;
private final String schemaArn;
private final String schemaName;
private final Instant updatedAt;
private SchemaMappingSummary(BuilderImpl builder) {
this.createdAt = builder.createdAt;
this.hasWorkflows = builder.hasWorkflows;
this.schemaArn = builder.schemaArn;
this.schemaName = builder.schemaName;
this.updatedAt = builder.updatedAt;
}
/**
*
* The timestamp of when the SchemaMapping
was created.
*
*
* @return The timestamp of when the SchemaMapping
was created.
*/
public final Instant createdAt() {
return createdAt;
}
/**
*
* Specifies whether the schema mapping has been applied to a workflow.
*
*
* @return Specifies whether the schema mapping has been applied to a workflow.
*/
public final Boolean hasWorkflows() {
return hasWorkflows;
}
/**
*
* The ARN (Amazon Resource Name) that Entity Resolution generated for the SchemaMapping
.
*
*
* @return The ARN (Amazon Resource Name) that Entity Resolution generated for the SchemaMapping
.
*/
public final String schemaArn() {
return schemaArn;
}
/**
*
* The name of the schema.
*
*
* @return The name of the schema.
*/
public final String schemaName() {
return schemaName;
}
/**
*
* The timestamp of when the SchemaMapping
was last updated.
*
*
* @return The timestamp of when the SchemaMapping
was last updated.
*/
public final Instant updatedAt() {
return updatedAt;
}
@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(createdAt());
hashCode = 31 * hashCode + Objects.hashCode(hasWorkflows());
hashCode = 31 * hashCode + Objects.hashCode(schemaArn());
hashCode = 31 * hashCode + Objects.hashCode(schemaName());
hashCode = 31 * hashCode + Objects.hashCode(updatedAt());
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 SchemaMappingSummary)) {
return false;
}
SchemaMappingSummary other = (SchemaMappingSummary) obj;
return Objects.equals(createdAt(), other.createdAt()) && Objects.equals(hasWorkflows(), other.hasWorkflows())
&& Objects.equals(schemaArn(), other.schemaArn()) && Objects.equals(schemaName(), other.schemaName())
&& Objects.equals(updatedAt(), other.updatedAt());
}
/**
* 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("SchemaMappingSummary").add("CreatedAt", createdAt()).add("HasWorkflows", hasWorkflows())
.add("SchemaArn", schemaArn()).add("SchemaName", schemaName()).add("UpdatedAt", updatedAt()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "createdAt":
return Optional.ofNullable(clazz.cast(createdAt()));
case "hasWorkflows":
return Optional.ofNullable(clazz.cast(hasWorkflows()));
case "schemaArn":
return Optional.ofNullable(clazz.cast(schemaArn()));
case "schemaName":
return Optional.ofNullable(clazz.cast(schemaName()));
case "updatedAt":
return Optional.ofNullable(clazz.cast(updatedAt()));
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("createdAt", CREATED_AT_FIELD);
map.put("hasWorkflows", HAS_WORKFLOWS_FIELD);
map.put("schemaArn", SCHEMA_ARN_FIELD);
map.put("schemaName", SCHEMA_NAME_FIELD);
map.put("updatedAt", UPDATED_AT_FIELD);
return Collections.unmodifiableMap(map);
}
private static Function
© 2015 - 2025 Weber Informatics LLC | Privacy Policy