software.amazon.awssdk.services.sms.model.ReplicationRun Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of servermigration Show documentation
Show all versions of servermigration Show documentation
The AWS Java SDK for AWS Server Migration module holds the client classes that are used for
communicating with AWS Server Migration Service
/*
* Copyright 2012-2017 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.sms.model;
import java.util.Date;
import javax.annotation.Generated;
import software.amazon.awssdk.annotation.SdkInternalApi;
import software.amazon.awssdk.protocol.ProtocolMarshaller;
import software.amazon.awssdk.protocol.StructuredPojo;
import software.amazon.awssdk.runtime.StandardMemberCopier;
import software.amazon.awssdk.services.sms.transform.ReplicationRunMarshaller;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
* Object representing a Replication Run
*/
@Generated("software.amazon.awssdk:codegen")
public class ReplicationRun implements StructuredPojo, ToCopyableBuilder {
private final String replicationRunId;
private final String state;
private final String type;
private final String statusMessage;
private final String amiId;
private final Date scheduledStartTime;
private final Date completedTime;
private final String description;
private ReplicationRun(BuilderImpl builder) {
this.replicationRunId = builder.replicationRunId;
this.state = builder.state;
this.type = builder.type;
this.statusMessage = builder.statusMessage;
this.amiId = builder.amiId;
this.scheduledStartTime = builder.scheduledStartTime;
this.completedTime = builder.completedTime;
this.description = builder.description;
}
/**
*
* @return
*/
public String replicationRunId() {
return replicationRunId;
}
/**
*
* @return
* @see ReplicationRunState
*/
public String state() {
return state;
}
/**
*
* @return
* @see ReplicationRunType
*/
public String type() {
return type;
}
/**
*
* @return
*/
public String statusMessage() {
return statusMessage;
}
/**
*
* @return
*/
public String amiId() {
return amiId;
}
/**
*
* @return
*/
public Date scheduledStartTime() {
return scheduledStartTime;
}
/**
*
* @return
*/
public Date completedTime() {
return completedTime;
}
/**
*
* @return
*/
public String description() {
return description;
}
@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 int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + ((replicationRunId() == null) ? 0 : replicationRunId().hashCode());
hashCode = 31 * hashCode + ((state() == null) ? 0 : state().hashCode());
hashCode = 31 * hashCode + ((type() == null) ? 0 : type().hashCode());
hashCode = 31 * hashCode + ((statusMessage() == null) ? 0 : statusMessage().hashCode());
hashCode = 31 * hashCode + ((amiId() == null) ? 0 : amiId().hashCode());
hashCode = 31 * hashCode + ((scheduledStartTime() == null) ? 0 : scheduledStartTime().hashCode());
hashCode = 31 * hashCode + ((completedTime() == null) ? 0 : completedTime().hashCode());
hashCode = 31 * hashCode + ((description() == null) ? 0 : description().hashCode());
return hashCode;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof ReplicationRun)) {
return false;
}
ReplicationRun other = (ReplicationRun) obj;
if (other.replicationRunId() == null ^ this.replicationRunId() == null) {
return false;
}
if (other.replicationRunId() != null && !other.replicationRunId().equals(this.replicationRunId())) {
return false;
}
if (other.state() == null ^ this.state() == null) {
return false;
}
if (other.state() != null && !other.state().equals(this.state())) {
return false;
}
if (other.type() == null ^ this.type() == null) {
return false;
}
if (other.type() != null && !other.type().equals(this.type())) {
return false;
}
if (other.statusMessage() == null ^ this.statusMessage() == null) {
return false;
}
if (other.statusMessage() != null && !other.statusMessage().equals(this.statusMessage())) {
return false;
}
if (other.amiId() == null ^ this.amiId() == null) {
return false;
}
if (other.amiId() != null && !other.amiId().equals(this.amiId())) {
return false;
}
if (other.scheduledStartTime() == null ^ this.scheduledStartTime() == null) {
return false;
}
if (other.scheduledStartTime() != null && !other.scheduledStartTime().equals(this.scheduledStartTime())) {
return false;
}
if (other.completedTime() == null ^ this.completedTime() == null) {
return false;
}
if (other.completedTime() != null && !other.completedTime().equals(this.completedTime())) {
return false;
}
if (other.description() == null ^ this.description() == null) {
return false;
}
if (other.description() != null && !other.description().equals(this.description())) {
return false;
}
return true;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (replicationRunId() != null) {
sb.append("ReplicationRunId: ").append(replicationRunId()).append(",");
}
if (state() != null) {
sb.append("State: ").append(state()).append(",");
}
if (type() != null) {
sb.append("Type: ").append(type()).append(",");
}
if (statusMessage() != null) {
sb.append("StatusMessage: ").append(statusMessage()).append(",");
}
if (amiId() != null) {
sb.append("AmiId: ").append(amiId()).append(",");
}
if (scheduledStartTime() != null) {
sb.append("ScheduledStartTime: ").append(scheduledStartTime()).append(",");
}
if (completedTime() != null) {
sb.append("CompletedTime: ").append(completedTime()).append(",");
}
if (description() != null) {
sb.append("Description: ").append(description()).append(",");
}
sb.append("}");
return sb.toString();
}
@SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
ReplicationRunMarshaller.getInstance().marshall(this, protocolMarshaller);
}
public interface Builder extends CopyableBuilder {
/**
*
* @param replicationRunId
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder replicationRunId(String replicationRunId);
/**
*
* @param state
* @return Returns a reference to this object so that method calls can be chained together.
* @see ReplicationRunState
*/
Builder state(String state);
/**
*
* @param state
* @return Returns a reference to this object so that method calls can be chained together.
* @see ReplicationRunState
*/
Builder state(ReplicationRunState state);
/**
*
* @param type
* @return Returns a reference to this object so that method calls can be chained together.
* @see ReplicationRunType
*/
Builder type(String type);
/**
*
* @param type
* @return Returns a reference to this object so that method calls can be chained together.
* @see ReplicationRunType
*/
Builder type(ReplicationRunType type);
/**
*
* @param statusMessage
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder statusMessage(String statusMessage);
/**
*
* @param amiId
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder amiId(String amiId);
/**
*
* @param scheduledStartTime
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder scheduledStartTime(Date scheduledStartTime);
/**
*
* @param completedTime
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder completedTime(Date completedTime);
/**
*
* @param description
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder description(String description);
}
private static final class BuilderImpl implements Builder {
private String replicationRunId;
private String state;
private String type;
private String statusMessage;
private String amiId;
private Date scheduledStartTime;
private Date completedTime;
private String description;
private BuilderImpl() {
}
private BuilderImpl(ReplicationRun model) {
setReplicationRunId(model.replicationRunId);
setState(model.state);
setType(model.type);
setStatusMessage(model.statusMessage);
setAmiId(model.amiId);
setScheduledStartTime(model.scheduledStartTime);
setCompletedTime(model.completedTime);
setDescription(model.description);
}
public final String getReplicationRunId() {
return replicationRunId;
}
@Override
public final Builder replicationRunId(String replicationRunId) {
this.replicationRunId = replicationRunId;
return this;
}
public final void setReplicationRunId(String replicationRunId) {
this.replicationRunId = replicationRunId;
}
public final String getState() {
return state;
}
@Override
public final Builder state(String state) {
this.state = state;
return this;
}
@Override
public final Builder state(ReplicationRunState state) {
this.state(state.toString());
return this;
}
public final void setState(String state) {
this.state = state;
}
public final void setState(ReplicationRunState state) {
this.state(state.toString());
}
public final String getType() {
return type;
}
@Override
public final Builder type(String type) {
this.type = type;
return this;
}
@Override
public final Builder type(ReplicationRunType type) {
this.type(type.toString());
return this;
}
public final void setType(String type) {
this.type = type;
}
public final void setType(ReplicationRunType type) {
this.type(type.toString());
}
public final String getStatusMessage() {
return statusMessage;
}
@Override
public final Builder statusMessage(String statusMessage) {
this.statusMessage = statusMessage;
return this;
}
public final void setStatusMessage(String statusMessage) {
this.statusMessage = statusMessage;
}
public final String getAmiId() {
return amiId;
}
@Override
public final Builder amiId(String amiId) {
this.amiId = amiId;
return this;
}
public final void setAmiId(String amiId) {
this.amiId = amiId;
}
public final Date getScheduledStartTime() {
return scheduledStartTime;
}
@Override
public final Builder scheduledStartTime(Date scheduledStartTime) {
this.scheduledStartTime = StandardMemberCopier.copy(scheduledStartTime);
return this;
}
public final void setScheduledStartTime(Date scheduledStartTime) {
this.scheduledStartTime = StandardMemberCopier.copy(scheduledStartTime);
}
public final Date getCompletedTime() {
return completedTime;
}
@Override
public final Builder completedTime(Date completedTime) {
this.completedTime = StandardMemberCopier.copy(completedTime);
return this;
}
public final void setCompletedTime(Date completedTime) {
this.completedTime = StandardMemberCopier.copy(completedTime);
}
public final String getDescription() {
return description;
}
@Override
public final Builder description(String description) {
this.description = description;
return this;
}
public final void setDescription(String description) {
this.description = description;
}
@Override
public ReplicationRun build() {
return new ReplicationRun(this);
}
}
}