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

software.amazon.awssdk.services.glue.model.FederatedTable Maven / Gradle / Ivy

Go to download

The AWS Java SDK for AWS Glue module holds the client classes that are used for communicating with AWS Glue Service

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.glue.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;

/**
 * 

* A table that points to an entity outside the Glue Data Catalog. *

*/ @Generated("software.amazon.awssdk:codegen") public final class FederatedTable implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField IDENTIFIER_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("Identifier").getter(getter(FederatedTable::identifier)).setter(setter(Builder::identifier)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Identifier").build()).build(); private static final SdkField DATABASE_IDENTIFIER_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("DatabaseIdentifier").getter(getter(FederatedTable::databaseIdentifier)) .setter(setter(Builder::databaseIdentifier)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DatabaseIdentifier").build()) .build(); private static final SdkField CONNECTION_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ConnectionName").getter(getter(FederatedTable::connectionName)).setter(setter(Builder::connectionName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ConnectionName").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(IDENTIFIER_FIELD, DATABASE_IDENTIFIER_FIELD, CONNECTION_NAME_FIELD)); private static final Map> SDK_NAME_TO_FIELD = memberNameToFieldInitializer(); private static final long serialVersionUID = 1L; private final String identifier; private final String databaseIdentifier; private final String connectionName; private FederatedTable(BuilderImpl builder) { this.identifier = builder.identifier; this.databaseIdentifier = builder.databaseIdentifier; this.connectionName = builder.connectionName; } /** *

* A unique identifier for the federated table. *

* * @return A unique identifier for the federated table. */ public final String identifier() { return identifier; } /** *

* A unique identifier for the federated database. *

* * @return A unique identifier for the federated database. */ public final String databaseIdentifier() { return databaseIdentifier; } /** *

* The name of the connection to the external metastore. *

* * @return The name of the connection to the external metastore. */ public final String connectionName() { return connectionName; } @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(identifier()); hashCode = 31 * hashCode + Objects.hashCode(databaseIdentifier()); hashCode = 31 * hashCode + Objects.hashCode(connectionName()); 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 FederatedTable)) { return false; } FederatedTable other = (FederatedTable) obj; return Objects.equals(identifier(), other.identifier()) && Objects.equals(databaseIdentifier(), other.databaseIdentifier()) && Objects.equals(connectionName(), other.connectionName()); } /** * 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("FederatedTable").add("Identifier", identifier()).add("DatabaseIdentifier", databaseIdentifier()) .add("ConnectionName", connectionName()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "Identifier": return Optional.ofNullable(clazz.cast(identifier())); case "DatabaseIdentifier": return Optional.ofNullable(clazz.cast(databaseIdentifier())); case "ConnectionName": return Optional.ofNullable(clazz.cast(connectionName())); 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("Identifier", IDENTIFIER_FIELD); map.put("DatabaseIdentifier", DATABASE_IDENTIFIER_FIELD); map.put("ConnectionName", CONNECTION_NAME_FIELD); return Collections.unmodifiableMap(map); } private static Function getter(Function g) { return obj -> g.apply((FederatedTable) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* A unique identifier for the federated table. *

* * @param identifier * A unique identifier for the federated table. * @return Returns a reference to this object so that method calls can be chained together. */ Builder identifier(String identifier); /** *

* A unique identifier for the federated database. *

* * @param databaseIdentifier * A unique identifier for the federated database. * @return Returns a reference to this object so that method calls can be chained together. */ Builder databaseIdentifier(String databaseIdentifier); /** *

* The name of the connection to the external metastore. *

* * @param connectionName * The name of the connection to the external metastore. * @return Returns a reference to this object so that method calls can be chained together. */ Builder connectionName(String connectionName); } static final class BuilderImpl implements Builder { private String identifier; private String databaseIdentifier; private String connectionName; private BuilderImpl() { } private BuilderImpl(FederatedTable model) { identifier(model.identifier); databaseIdentifier(model.databaseIdentifier); connectionName(model.connectionName); } public final String getIdentifier() { return identifier; } public final void setIdentifier(String identifier) { this.identifier = identifier; } @Override public final Builder identifier(String identifier) { this.identifier = identifier; return this; } public final String getDatabaseIdentifier() { return databaseIdentifier; } public final void setDatabaseIdentifier(String databaseIdentifier) { this.databaseIdentifier = databaseIdentifier; } @Override public final Builder databaseIdentifier(String databaseIdentifier) { this.databaseIdentifier = databaseIdentifier; return this; } public final String getConnectionName() { return connectionName; } public final void setConnectionName(String connectionName) { this.connectionName = connectionName; } @Override public final Builder connectionName(String connectionName) { this.connectionName = connectionName; return this; } @Override public FederatedTable build() { return new FederatedTable(this); } @Override public List> sdkFields() { return SDK_FIELDS; } @Override public Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy