
com.amazonaws.services.databasemigrationservice.model.Connection Maven / Gradle / Ivy
Show all versions of aws-java-sdk-dms Show documentation
/*
* Copyright 2010-2016 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.databasemigrationservice.model;
import java.io.Serializable;
/**
*
*/
public class Connection implements Serializable, Cloneable {
/**
*
* The Amazon Resource Name (ARN) of the replication instance.
*
*/
private String replicationInstanceArn;
/**
*
* The Amazon Resource Name (ARN) string that uniquely identifies the
* endpoint.
*
*/
private String endpointArn;
/**
*
* The connection status.
*
*/
private String status;
/**
*
* The error message when the connection last failed.
*
*/
private String lastFailureMessage;
/**
*
* The identifier of the endpoint. Identifiers must begin with a letter;
* must contain only ASCII letters, digits, and hyphens; and must not end
* with a hyphen or contain two consecutive hyphens.
*
*/
private String endpointIdentifier;
/**
*
* The replication instance identifier. This parameter is stored as a
* lowercase string.
*
*/
private String replicationInstanceIdentifier;
/**
*
* The Amazon Resource Name (ARN) of the replication instance.
*
*
* @param replicationInstanceArn
* The Amazon Resource Name (ARN) of the replication instance.
*/
public void setReplicationInstanceArn(String replicationInstanceArn) {
this.replicationInstanceArn = replicationInstanceArn;
}
/**
*
* The Amazon Resource Name (ARN) of the replication instance.
*
*
* @return The Amazon Resource Name (ARN) of the replication instance.
*/
public String getReplicationInstanceArn() {
return this.replicationInstanceArn;
}
/**
*
* The Amazon Resource Name (ARN) of the replication instance.
*
*
* @param replicationInstanceArn
* The Amazon Resource Name (ARN) of the replication instance.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public Connection withReplicationInstanceArn(String replicationInstanceArn) {
setReplicationInstanceArn(replicationInstanceArn);
return this;
}
/**
*
* The Amazon Resource Name (ARN) string that uniquely identifies the
* endpoint.
*
*
* @param endpointArn
* The Amazon Resource Name (ARN) string that uniquely identifies the
* endpoint.
*/
public void setEndpointArn(String endpointArn) {
this.endpointArn = endpointArn;
}
/**
*
* The Amazon Resource Name (ARN) string that uniquely identifies the
* endpoint.
*
*
* @return The Amazon Resource Name (ARN) string that uniquely identifies
* the endpoint.
*/
public String getEndpointArn() {
return this.endpointArn;
}
/**
*
* The Amazon Resource Name (ARN) string that uniquely identifies the
* endpoint.
*
*
* @param endpointArn
* The Amazon Resource Name (ARN) string that uniquely identifies the
* endpoint.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public Connection withEndpointArn(String endpointArn) {
setEndpointArn(endpointArn);
return this;
}
/**
*
* The connection status.
*
*
* @param status
* The connection status.
*/
public void setStatus(String status) {
this.status = status;
}
/**
*
* The connection status.
*
*
* @return The connection status.
*/
public String getStatus() {
return this.status;
}
/**
*
* The connection status.
*
*
* @param status
* The connection status.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public Connection withStatus(String status) {
setStatus(status);
return this;
}
/**
*
* The error message when the connection last failed.
*
*
* @param lastFailureMessage
* The error message when the connection last failed.
*/
public void setLastFailureMessage(String lastFailureMessage) {
this.lastFailureMessage = lastFailureMessage;
}
/**
*
* The error message when the connection last failed.
*
*
* @return The error message when the connection last failed.
*/
public String getLastFailureMessage() {
return this.lastFailureMessage;
}
/**
*
* The error message when the connection last failed.
*
*
* @param lastFailureMessage
* The error message when the connection last failed.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public Connection withLastFailureMessage(String lastFailureMessage) {
setLastFailureMessage(lastFailureMessage);
return this;
}
/**
*
* The identifier of the endpoint. Identifiers must begin with a letter;
* must contain only ASCII letters, digits, and hyphens; and must not end
* with a hyphen or contain two consecutive hyphens.
*
*
* @param endpointIdentifier
* The identifier of the endpoint. Identifiers must begin with a
* letter; must contain only ASCII letters, digits, and hyphens; and
* must not end with a hyphen or contain two consecutive hyphens.
*/
public void setEndpointIdentifier(String endpointIdentifier) {
this.endpointIdentifier = endpointIdentifier;
}
/**
*
* The identifier of the endpoint. Identifiers must begin with a letter;
* must contain only ASCII letters, digits, and hyphens; and must not end
* with a hyphen or contain two consecutive hyphens.
*
*
* @return The identifier of the endpoint. Identifiers must begin with a
* letter; must contain only ASCII letters, digits, and hyphens; and
* must not end with a hyphen or contain two consecutive hyphens.
*/
public String getEndpointIdentifier() {
return this.endpointIdentifier;
}
/**
*
* The identifier of the endpoint. Identifiers must begin with a letter;
* must contain only ASCII letters, digits, and hyphens; and must not end
* with a hyphen or contain two consecutive hyphens.
*
*
* @param endpointIdentifier
* The identifier of the endpoint. Identifiers must begin with a
* letter; must contain only ASCII letters, digits, and hyphens; and
* must not end with a hyphen or contain two consecutive hyphens.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public Connection withEndpointIdentifier(String endpointIdentifier) {
setEndpointIdentifier(endpointIdentifier);
return this;
}
/**
*
* The replication instance identifier. This parameter is stored as a
* lowercase string.
*
*
* @param replicationInstanceIdentifier
* The replication instance identifier. This parameter is stored as a
* lowercase string.
*/
public void setReplicationInstanceIdentifier(
String replicationInstanceIdentifier) {
this.replicationInstanceIdentifier = replicationInstanceIdentifier;
}
/**
*
* The replication instance identifier. This parameter is stored as a
* lowercase string.
*
*
* @return The replication instance identifier. This parameter is stored as
* a lowercase string.
*/
public String getReplicationInstanceIdentifier() {
return this.replicationInstanceIdentifier;
}
/**
*
* The replication instance identifier. This parameter is stored as a
* lowercase string.
*
*
* @param replicationInstanceIdentifier
* The replication instance identifier. This parameter is stored as a
* lowercase string.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public Connection withReplicationInstanceIdentifier(
String replicationInstanceIdentifier) {
setReplicationInstanceIdentifier(replicationInstanceIdentifier);
return this;
}
/**
* Returns a string representation of this object; useful for testing and
* debugging.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getReplicationInstanceArn() != null)
sb.append("ReplicationInstanceArn: " + getReplicationInstanceArn()
+ ",");
if (getEndpointArn() != null)
sb.append("EndpointArn: " + getEndpointArn() + ",");
if (getStatus() != null)
sb.append("Status: " + getStatus() + ",");
if (getLastFailureMessage() != null)
sb.append("LastFailureMessage: " + getLastFailureMessage() + ",");
if (getEndpointIdentifier() != null)
sb.append("EndpointIdentifier: " + getEndpointIdentifier() + ",");
if (getReplicationInstanceIdentifier() != null)
sb.append("ReplicationInstanceIdentifier: "
+ getReplicationInstanceIdentifier());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof Connection == false)
return false;
Connection other = (Connection) obj;
if (other.getReplicationInstanceArn() == null
^ this.getReplicationInstanceArn() == null)
return false;
if (other.getReplicationInstanceArn() != null
&& other.getReplicationInstanceArn().equals(
this.getReplicationInstanceArn()) == false)
return false;
if (other.getEndpointArn() == null ^ this.getEndpointArn() == null)
return false;
if (other.getEndpointArn() != null
&& other.getEndpointArn().equals(this.getEndpointArn()) == false)
return false;
if (other.getStatus() == null ^ this.getStatus() == null)
return false;
if (other.getStatus() != null
&& other.getStatus().equals(this.getStatus()) == false)
return false;
if (other.getLastFailureMessage() == null
^ this.getLastFailureMessage() == null)
return false;
if (other.getLastFailureMessage() != null
&& other.getLastFailureMessage().equals(
this.getLastFailureMessage()) == false)
return false;
if (other.getEndpointIdentifier() == null
^ this.getEndpointIdentifier() == null)
return false;
if (other.getEndpointIdentifier() != null
&& other.getEndpointIdentifier().equals(
this.getEndpointIdentifier()) == false)
return false;
if (other.getReplicationInstanceIdentifier() == null
^ this.getReplicationInstanceIdentifier() == null)
return false;
if (other.getReplicationInstanceIdentifier() != null
&& other.getReplicationInstanceIdentifier().equals(
this.getReplicationInstanceIdentifier()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime
* hashCode
+ ((getReplicationInstanceArn() == null) ? 0
: getReplicationInstanceArn().hashCode());
hashCode = prime
* hashCode
+ ((getEndpointArn() == null) ? 0 : getEndpointArn().hashCode());
hashCode = prime * hashCode
+ ((getStatus() == null) ? 0 : getStatus().hashCode());
hashCode = prime
* hashCode
+ ((getLastFailureMessage() == null) ? 0
: getLastFailureMessage().hashCode());
hashCode = prime
* hashCode
+ ((getEndpointIdentifier() == null) ? 0
: getEndpointIdentifier().hashCode());
hashCode = prime
* hashCode
+ ((getReplicationInstanceIdentifier() == null) ? 0
: getReplicationInstanceIdentifier().hashCode());
return hashCode;
}
@Override
public Connection clone() {
try {
return (Connection) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException(
"Got a CloneNotSupportedException from Object.clone() "
+ "even though we're Cloneable!", e);
}
}
}