/* * 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; /** *
* The structure used to create or update a database. *
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class DatabaseInput implements Serializable, Cloneable, StructuredPojo { /** ** The name of the database. For Hive compatibility, this is folded to lowercase when it is stored. *
*/ private String name; /** ** A description of the database. *
*/ private String description; /** ** The location of the database (for example, an HDFS path). *
*/ private String locationUri; /** ** These key-value pairs define parameters and properties of the database. *
** These key-value pairs define parameters and properties of the database. *
*/ private java.util.Map* Creates a set of default permissions on the table for principals. Used by Lake Formation. Not used in the normal * course of Glue operations. *
*/ private java.util.List
* A DatabaseIdentifier
structure that describes a target database for resource linking.
*
* A FederatedDatabase
structure that references an entity outside the Glue Data Catalog.
*
* The name of the database. For Hive compatibility, this is folded to lowercase when it is stored. *
* * @param name * The name of the database. For Hive compatibility, this is folded to lowercase when it is stored. */ public void setName(String name) { this.name = name; } /** ** The name of the database. For Hive compatibility, this is folded to lowercase when it is stored. *
* * @return The name of the database. For Hive compatibility, this is folded to lowercase when it is stored. */ public String getName() { return this.name; } /** ** The name of the database. For Hive compatibility, this is folded to lowercase when it is stored. *
* * @param name * The name of the database. For Hive compatibility, this is folded to lowercase when it is stored. * @return Returns a reference to this object so that method calls can be chained together. */ public DatabaseInput withName(String name) { setName(name); return this; } /** ** A description of the database. *
* * @param description * A description of the database. */ public void setDescription(String description) { this.description = description; } /** ** A description of the database. *
* * @return A description of the database. */ public String getDescription() { return this.description; } /** ** A description of the database. *
* * @param description * A description of the database. * @return Returns a reference to this object so that method calls can be chained together. */ public DatabaseInput withDescription(String description) { setDescription(description); return this; } /** ** The location of the database (for example, an HDFS path). *
* * @param locationUri * The location of the database (for example, an HDFS path). */ public void setLocationUri(String locationUri) { this.locationUri = locationUri; } /** ** The location of the database (for example, an HDFS path). *
* * @return The location of the database (for example, an HDFS path). */ public String getLocationUri() { return this.locationUri; } /** ** The location of the database (for example, an HDFS path). *
* * @param locationUri * The location of the database (for example, an HDFS path). * @return Returns a reference to this object so that method calls can be chained together. */ public DatabaseInput withLocationUri(String locationUri) { setLocationUri(locationUri); return this; } /** ** These key-value pairs define parameters and properties of the database. *
** These key-value pairs define parameters and properties of the database. *
* * @return These key-value pairs define parameters and properties of the database. *
* These key-value pairs define parameters and properties of the database.
*/
public java.util.Map
* These key-value pairs define parameters and properties of the database.
*
* These key-value pairs define parameters and properties of the database.
*
* These key-value pairs define parameters and properties of the database.
*/
public void setParameters(java.util.Map
* These key-value pairs define parameters and properties of the database.
*
* These key-value pairs define parameters and properties of the database.
*
* These key-value pairs define parameters and properties of the database.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DatabaseInput withParameters(java.util.Map
* Creates a set of default permissions on the table for principals. Used by Lake Formation. Not used in the normal
* course of Glue operations.
*
* Creates a set of default permissions on the table for principals. Used by Lake Formation. Not used in the normal
* course of Glue operations.
*
* Creates a set of default permissions on the table for principals. Used by Lake Formation. Not used in the normal
* course of Glue operations.
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setCreateTableDefaultPermissions(java.util.Collection)} or
* {@link #withCreateTableDefaultPermissions(java.util.Collection)} if you want to override the existing values.
*
* Creates a set of default permissions on the table for principals. Used by Lake Formation. Not used in the normal
* course of Glue operations.
*
* A
* A
* A
* A
* A
* A DatabaseIdentifier
structure that describes a target database for resource linking.
* DatabaseIdentifier
structure that describes a target database for resource linking.
*/
public void setTargetDatabase(DatabaseIdentifier targetDatabase) {
this.targetDatabase = targetDatabase;
}
/**
* DatabaseIdentifier
structure that describes a target database for resource linking.
* DatabaseIdentifier
structure that describes a target database for resource linking.
*/
public DatabaseIdentifier getTargetDatabase() {
return this.targetDatabase;
}
/**
* DatabaseIdentifier
structure that describes a target database for resource linking.
* DatabaseIdentifier
structure that describes a target database for resource linking.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DatabaseInput withTargetDatabase(DatabaseIdentifier targetDatabase) {
setTargetDatabase(targetDatabase);
return this;
}
/**
* FederatedDatabase
structure that references an entity outside the Glue Data Catalog.
* FederatedDatabase
structure that references an entity outside the Glue Data Catalog.
*/
public void setFederatedDatabase(FederatedDatabase federatedDatabase) {
this.federatedDatabase = federatedDatabase;
}
/**
* FederatedDatabase
structure that references an entity outside the Glue Data Catalog.
* FederatedDatabase
structure that references an entity outside the Glue Data Catalog.
*/
public FederatedDatabase getFederatedDatabase() {
return this.federatedDatabase;
}
/**
* FederatedDatabase
structure that references an entity outside the Glue Data Catalog.
* FederatedDatabase
structure that references an entity outside the Glue Data Catalog.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DatabaseInput withFederatedDatabase(FederatedDatabase federatedDatabase) {
setFederatedDatabase(federatedDatabase);
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 (getDescription() != null)
sb.append("Description: ").append(getDescription()).append(",");
if (getLocationUri() != null)
sb.append("LocationUri: ").append(getLocationUri()).append(",");
if (getParameters() != null)
sb.append("Parameters: ").append(getParameters()).append(",");
if (getCreateTableDefaultPermissions() != null)
sb.append("CreateTableDefaultPermissions: ").append(getCreateTableDefaultPermissions()).append(",");
if (getTargetDatabase() != null)
sb.append("TargetDatabase: ").append(getTargetDatabase()).append(",");
if (getFederatedDatabase() != null)
sb.append("FederatedDatabase: ").append(getFederatedDatabase());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof DatabaseInput == false)
return false;
DatabaseInput other = (DatabaseInput) obj;
if (other.getName() == null ^ this.getName() == null)
return false;
if (other.getName() != null && other.getName().equals(this.getName()) == false)
return false;
if (other.getDescription() == null ^ this.getDescription() == null)
return false;
if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == false)
return false;
if (other.getLocationUri() == null ^ this.getLocationUri() == null)
return false;
if (other.getLocationUri() != null && other.getLocationUri().equals(this.getLocationUri()) == false)
return false;
if (other.getParameters() == null ^ this.getParameters() == null)
return false;
if (other.getParameters() != null && other.getParameters().equals(this.getParameters()) == false)
return false;
if (other.getCreateTableDefaultPermissions() == null ^ this.getCreateTableDefaultPermissions() == null)
return false;
if (other.getCreateTableDefaultPermissions() != null
&& other.getCreateTableDefaultPermissions().equals(this.getCreateTableDefaultPermissions()) == false)
return false;
if (other.getTargetDatabase() == null ^ this.getTargetDatabase() == null)
return false;
if (other.getTargetDatabase() != null && other.getTargetDatabase().equals(this.getTargetDatabase()) == false)
return false;
if (other.getFederatedDatabase() == null ^ this.getFederatedDatabase() == null)
return false;
if (other.getFederatedDatabase() != null && other.getFederatedDatabase().equals(this.getFederatedDatabase()) == 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 + ((getDescription() == null) ? 0 : getDescription().hashCode());
hashCode = prime * hashCode + ((getLocationUri() == null) ? 0 : getLocationUri().hashCode());
hashCode = prime * hashCode + ((getParameters() == null) ? 0 : getParameters().hashCode());
hashCode = prime * hashCode + ((getCreateTableDefaultPermissions() == null) ? 0 : getCreateTableDefaultPermissions().hashCode());
hashCode = prime * hashCode + ((getTargetDatabase() == null) ? 0 : getTargetDatabase().hashCode());
hashCode = prime * hashCode + ((getFederatedDatabase() == null) ? 0 : getFederatedDatabase().hashCode());
return hashCode;
}
@Override
public DatabaseInput clone() {
try {
return (DatabaseInput) 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.DatabaseInputMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}