/* * Copyright 2018-2023 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 com.amazonaws.services.glue.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *

* Specifies a connector to a JDBC data source. *

* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class JDBCConnectorSource implements Serializable, Cloneable, StructuredPojo { /** *

* The name of the data source. *

*/ private String name; /** *

* The name of the connection that is associated with the connector. *

*/ private String connectionName; /** *

* The name of a connector that assists with accessing the data store in Glue Studio. *

*/ private String connectorName; /** *

* The type of connection, such as marketplace.jdbc or custom.jdbc, designating a connection to a JDBC data store. *

*/ private String connectionType; /** *

* Additional connection options for the connector. *

*/ private JDBCConnectorOptions additionalOptions; /** *

* The name of the table in the data source. *

*/ private String connectionTable; /** *

* The table or SQL query to get the data from. You can specify either ConnectionTable or * query, but not both. *

*/ private String query; /** *

* Specifies the data schema for the custom JDBC source. *

*/ private java.util.List outputSchemas; /** *

* The name of the data source. *

* * @param name * The name of the data source. */ public void setName(String name) { this.name = name; } /** *

* The name of the data source. *

* * @return The name of the data source. */ public String getName() { return this.name; } /** *

* The name of the data source. *

* * @param name * The name of the data source. * @return Returns a reference to this object so that method calls can be chained together. */ public JDBCConnectorSource withName(String name) { setName(name); return this; } /** *

* The name of the connection that is associated with the connector. *

* * @param connectionName * The name of the connection that is associated with the connector. */ public void setConnectionName(String connectionName) { this.connectionName = connectionName; } /** *

* The name of the connection that is associated with the connector. *

* * @return The name of the connection that is associated with the connector. */ public String getConnectionName() { return this.connectionName; } /** *

* The name of the connection that is associated with the connector. *

* * @param connectionName * The name of the connection that is associated with the connector. * @return Returns a reference to this object so that method calls can be chained together. */ public JDBCConnectorSource withConnectionName(String connectionName) { setConnectionName(connectionName); return this; } /** *

* The name of a connector that assists with accessing the data store in Glue Studio. *

* * @param connectorName * The name of a connector that assists with accessing the data store in Glue Studio. */ public void setConnectorName(String connectorName) { this.connectorName = connectorName; } /** *

* The name of a connector that assists with accessing the data store in Glue Studio. *

* * @return The name of a connector that assists with accessing the data store in Glue Studio. */ public String getConnectorName() { return this.connectorName; } /** *

* The name of a connector that assists with accessing the data store in Glue Studio. *

* * @param connectorName * The name of a connector that assists with accessing the data store in Glue Studio. * @return Returns a reference to this object so that method calls can be chained together. */ public JDBCConnectorSource withConnectorName(String connectorName) { setConnectorName(connectorName); return this; } /** *

* The type of connection, such as marketplace.jdbc or custom.jdbc, designating a connection to a JDBC data store. *

* * @param connectionType * The type of connection, such as marketplace.jdbc or custom.jdbc, designating a connection to a JDBC data * store. */ public void setConnectionType(String connectionType) { this.connectionType = connectionType; } /** *

* The type of connection, such as marketplace.jdbc or custom.jdbc, designating a connection to a JDBC data store. *

* * @return The type of connection, such as marketplace.jdbc or custom.jdbc, designating a connection to a JDBC data * store. */ public String getConnectionType() { return this.connectionType; } /** *

* The type of connection, such as marketplace.jdbc or custom.jdbc, designating a connection to a JDBC data store. *

* * @param connectionType * The type of connection, such as marketplace.jdbc or custom.jdbc, designating a connection to a JDBC data * store. * @return Returns a reference to this object so that method calls can be chained together. */ public JDBCConnectorSource withConnectionType(String connectionType) { setConnectionType(connectionType); return this; } /** *

* Additional connection options for the connector. *

* * @param additionalOptions * Additional connection options for the connector. */ public void setAdditionalOptions(JDBCConnectorOptions additionalOptions) { this.additionalOptions = additionalOptions; } /** *

* Additional connection options for the connector. *

* * @return Additional connection options for the connector. */ public JDBCConnectorOptions getAdditionalOptions() { return this.additionalOptions; } /** *

* Additional connection options for the connector. *

* * @param additionalOptions * Additional connection options for the connector. * @return Returns a reference to this object so that method calls can be chained together. */ public JDBCConnectorSource withAdditionalOptions(JDBCConnectorOptions additionalOptions) { setAdditionalOptions(additionalOptions); return this; } /** *

* The name of the table in the data source. *

* * @param connectionTable * The name of the table in the data source. */ public void setConnectionTable(String connectionTable) { this.connectionTable = connectionTable; } /** *

* The name of the table in the data source. *

* * @return The name of the table in the data source. */ public String getConnectionTable() { return this.connectionTable; } /** *

* The name of the table in the data source. *

* * @param connectionTable * The name of the table in the data source. * @return Returns a reference to this object so that method calls can be chained together. */ public JDBCConnectorSource withConnectionTable(String connectionTable) { setConnectionTable(connectionTable); return this; } /** *

* The table or SQL query to get the data from. You can specify either ConnectionTable or * query, but not both. *

* * @param query * The table or SQL query to get the data from. You can specify either ConnectionTable or * query, but not both. */ public void setQuery(String query) { this.query = query; } /** *

* The table or SQL query to get the data from. You can specify either ConnectionTable or * query, but not both. *

* * @return The table or SQL query to get the data from. You can specify either ConnectionTable or * query, but not both. */ public String getQuery() { return this.query; } /** *

* The table or SQL query to get the data from. You can specify either ConnectionTable or * query, but not both. *

* * @param query * The table or SQL query to get the data from. You can specify either ConnectionTable or * query, but not both. * @return Returns a reference to this object so that method calls can be chained together. */ public JDBCConnectorSource withQuery(String query) { setQuery(query); return this; } /** *

* Specifies the data schema for the custom JDBC source. *

* * @return Specifies the data schema for the custom JDBC source. */ public java.util.List getOutputSchemas() { return outputSchemas; } /** *

* Specifies the data schema for the custom JDBC source. *

* * @param outputSchemas * Specifies the data schema for the custom JDBC source. */ public void setOutputSchemas(java.util.Collection outputSchemas) { if (outputSchemas == null) { this.outputSchemas = null; return; } this.outputSchemas = new java.util.ArrayList(outputSchemas); } /** *

* Specifies the data schema for the custom JDBC source. *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setOutputSchemas(java.util.Collection)} or {@link #withOutputSchemas(java.util.Collection)} if you want * to override the existing values. *

* * @param outputSchemas * Specifies the data schema for the custom JDBC source. * @return Returns a reference to this object so that method calls can be chained together. */ public JDBCConnectorSource withOutputSchemas(GlueSchema... outputSchemas) { if (this.outputSchemas == null) { setOutputSchemas(new java.util.ArrayList(outputSchemas.length)); } for (GlueSchema ele : outputSchemas) { this.outputSchemas.add(ele); } return this; } /** *

* Specifies the data schema for the custom JDBC source. *

* * @param outputSchemas * Specifies the data schema for the custom JDBC source. * @return Returns a reference to this object so that method calls can be chained together. */ public JDBCConnectorSource withOutputSchemas(java.util.Collection outputSchemas) { setOutputSchemas(outputSchemas); return this; } /** * 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. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getName() != null) sb.append("Name: ").append(getName()).append(","); if (getConnectionName() != null) sb.append("ConnectionName: ").append(getConnectionName()).append(","); if (getConnectorName() != null) sb.append("ConnectorName: ").append(getConnectorName()).append(","); if (getConnectionType() != null) sb.append("ConnectionType: ").append(getConnectionType()).append(","); if (getAdditionalOptions() != null) sb.append("AdditionalOptions: ").append(getAdditionalOptions()).append(","); if (getConnectionTable() != null) sb.append("ConnectionTable: ").append(getConnectionTable()).append(","); if (getQuery() != null) sb.append("Query: ").append(getQuery()).append(","); if (getOutputSchemas() != null) sb.append("OutputSchemas: ").append(getOutputSchemas()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof JDBCConnectorSource == false) return false; JDBCConnectorSource other = (JDBCConnectorSource) obj; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getConnectionName() == null ^ this.getConnectionName() == null) return false; if (other.getConnectionName() != null && other.getConnectionName().equals(this.getConnectionName()) == false) return false; if (other.getConnectorName() == null ^ this.getConnectorName() == null) return false; if (other.getConnectorName() != null && other.getConnectorName().equals(this.getConnectorName()) == false) return false; if (other.getConnectionType() == null ^ this.getConnectionType() == null) return false; if (other.getConnectionType() != null && other.getConnectionType().equals(this.getConnectionType()) == false) return false; if (other.getAdditionalOptions() == null ^ this.getAdditionalOptions() == null) return false; if (other.getAdditionalOptions() != null && other.getAdditionalOptions().equals(this.getAdditionalOptions()) == false) return false; if (other.getConnectionTable() == null ^ this.getConnectionTable() == null) return false; if (other.getConnectionTable() != null && other.getConnectionTable().equals(this.getConnectionTable()) == false) return false; if (other.getQuery() == null ^ this.getQuery() == null) return false; if (other.getQuery() != null && other.getQuery().equals(this.getQuery()) == false) return false; if (other.getOutputSchemas() == null ^ this.getOutputSchemas() == null) return false; if (other.getOutputSchemas() != null && other.getOutputSchemas().equals(this.getOutputSchemas()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getConnectionName() == null) ? 0 : getConnectionName().hashCode()); hashCode = prime * hashCode + ((getConnectorName() == null) ? 0 : getConnectorName().hashCode()); hashCode = prime * hashCode + ((getConnectionType() == null) ? 0 : getConnectionType().hashCode()); hashCode = prime * hashCode + ((getAdditionalOptions() == null) ? 0 : getAdditionalOptions().hashCode()); hashCode = prime * hashCode + ((getConnectionTable() == null) ? 0 : getConnectionTable().hashCode()); hashCode = prime * hashCode + ((getQuery() == null) ? 0 : getQuery().hashCode()); hashCode = prime * hashCode + ((getOutputSchemas() == null) ? 0 : getOutputSchemas().hashCode()); return hashCode; } @Override public JDBCConnectorSource clone() { try { return (JDBCConnectorSource) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } @com.amazonaws.annotation.SdkInternalApi @Override public void marshall(ProtocolMarshaller protocolMarshaller) { com.amazonaws.services.glue.model.transform.JDBCConnectorSourceMarshaller.getInstance().marshall(this, protocolMarshaller); } }