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

com.amazonaws.services.drs.model.Job Maven / Gradle / Ivy

Go to download

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

There is a newer version: 1.12.772
Show newest version
/*
 * 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.drs.model;

import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;

/**
 * 

* A job is an asynchronous workflow. *

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

* The ARN of a Job. *

*/ private String arn; /** *

* The date and time of when the Job was created. *

*/ private String creationDateTime; /** *

* The date and time of when the Job ended. *

*/ private String endDateTime; /** *

* A string representing who initiated the Job. *

*/ private String initiatedBy; /** *

* The ID of the Job. *

*/ private String jobID; /** *

* A list of resources that the Job is acting upon. *

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

* A list of servers that the Job is acting upon. *

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

* The status of the Job. *

*/ private String status; /** *

* A list of tags associated with the Job. *

*/ private java.util.Map tags; /** *

* The type of the Job. *

*/ private String type; /** *

* The ARN of a Job. *

* * @param arn * The ARN of a Job. */ public void setArn(String arn) { this.arn = arn; } /** *

* The ARN of a Job. *

* * @return The ARN of a Job. */ public String getArn() { return this.arn; } /** *

* The ARN of a Job. *

* * @param arn * The ARN of a Job. * @return Returns a reference to this object so that method calls can be chained together. */ public Job withArn(String arn) { setArn(arn); return this; } /** *

* The date and time of when the Job was created. *

* * @param creationDateTime * The date and time of when the Job was created. */ public void setCreationDateTime(String creationDateTime) { this.creationDateTime = creationDateTime; } /** *

* The date and time of when the Job was created. *

* * @return The date and time of when the Job was created. */ public String getCreationDateTime() { return this.creationDateTime; } /** *

* The date and time of when the Job was created. *

* * @param creationDateTime * The date and time of when the Job was created. * @return Returns a reference to this object so that method calls can be chained together. */ public Job withCreationDateTime(String creationDateTime) { setCreationDateTime(creationDateTime); return this; } /** *

* The date and time of when the Job ended. *

* * @param endDateTime * The date and time of when the Job ended. */ public void setEndDateTime(String endDateTime) { this.endDateTime = endDateTime; } /** *

* The date and time of when the Job ended. *

* * @return The date and time of when the Job ended. */ public String getEndDateTime() { return this.endDateTime; } /** *

* The date and time of when the Job ended. *

* * @param endDateTime * The date and time of when the Job ended. * @return Returns a reference to this object so that method calls can be chained together. */ public Job withEndDateTime(String endDateTime) { setEndDateTime(endDateTime); return this; } /** *

* A string representing who initiated the Job. *

* * @param initiatedBy * A string representing who initiated the Job. * @see InitiatedBy */ public void setInitiatedBy(String initiatedBy) { this.initiatedBy = initiatedBy; } /** *

* A string representing who initiated the Job. *

* * @return A string representing who initiated the Job. * @see InitiatedBy */ public String getInitiatedBy() { return this.initiatedBy; } /** *

* A string representing who initiated the Job. *

* * @param initiatedBy * A string representing who initiated the Job. * @return Returns a reference to this object so that method calls can be chained together. * @see InitiatedBy */ public Job withInitiatedBy(String initiatedBy) { setInitiatedBy(initiatedBy); return this; } /** *

* A string representing who initiated the Job. *

* * @param initiatedBy * A string representing who initiated the Job. * @return Returns a reference to this object so that method calls can be chained together. * @see InitiatedBy */ public Job withInitiatedBy(InitiatedBy initiatedBy) { this.initiatedBy = initiatedBy.toString(); return this; } /** *

* The ID of the Job. *

* * @param jobID * The ID of the Job. */ public void setJobID(String jobID) { this.jobID = jobID; } /** *

* The ID of the Job. *

* * @return The ID of the Job. */ public String getJobID() { return this.jobID; } /** *

* The ID of the Job. *

* * @param jobID * The ID of the Job. * @return Returns a reference to this object so that method calls can be chained together. */ public Job withJobID(String jobID) { setJobID(jobID); return this; } /** *

* A list of resources that the Job is acting upon. *

* * @return A list of resources that the Job is acting upon. */ public java.util.List getParticipatingResources() { return participatingResources; } /** *

* A list of resources that the Job is acting upon. *

* * @param participatingResources * A list of resources that the Job is acting upon. */ public void setParticipatingResources(java.util.Collection participatingResources) { if (participatingResources == null) { this.participatingResources = null; return; } this.participatingResources = new java.util.ArrayList(participatingResources); } /** *

* A list of resources that the Job is acting upon. *

*

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

* * @param participatingResources * A list of resources that the Job is acting upon. * @return Returns a reference to this object so that method calls can be chained together. */ public Job withParticipatingResources(ParticipatingResource... participatingResources) { if (this.participatingResources == null) { setParticipatingResources(new java.util.ArrayList(participatingResources.length)); } for (ParticipatingResource ele : participatingResources) { this.participatingResources.add(ele); } return this; } /** *

* A list of resources that the Job is acting upon. *

* * @param participatingResources * A list of resources that the Job is acting upon. * @return Returns a reference to this object so that method calls can be chained together. */ public Job withParticipatingResources(java.util.Collection participatingResources) { setParticipatingResources(participatingResources); return this; } /** *

* A list of servers that the Job is acting upon. *

* * @return A list of servers that the Job is acting upon. */ public java.util.List getParticipatingServers() { return participatingServers; } /** *

* A list of servers that the Job is acting upon. *

* * @param participatingServers * A list of servers that the Job is acting upon. */ public void setParticipatingServers(java.util.Collection participatingServers) { if (participatingServers == null) { this.participatingServers = null; return; } this.participatingServers = new java.util.ArrayList(participatingServers); } /** *

* A list of servers that the Job is acting upon. *

*

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

* * @param participatingServers * A list of servers that the Job is acting upon. * @return Returns a reference to this object so that method calls can be chained together. */ public Job withParticipatingServers(ParticipatingServer... participatingServers) { if (this.participatingServers == null) { setParticipatingServers(new java.util.ArrayList(participatingServers.length)); } for (ParticipatingServer ele : participatingServers) { this.participatingServers.add(ele); } return this; } /** *

* A list of servers that the Job is acting upon. *

* * @param participatingServers * A list of servers that the Job is acting upon. * @return Returns a reference to this object so that method calls can be chained together. */ public Job withParticipatingServers(java.util.Collection participatingServers) { setParticipatingServers(participatingServers); return this; } /** *

* The status of the Job. *

* * @param status * The status of the Job. * @see JobStatus */ public void setStatus(String status) { this.status = status; } /** *

* The status of the Job. *

* * @return The status of the Job. * @see JobStatus */ public String getStatus() { return this.status; } /** *

* The status of the Job. *

* * @param status * The status of the Job. * @return Returns a reference to this object so that method calls can be chained together. * @see JobStatus */ public Job withStatus(String status) { setStatus(status); return this; } /** *

* The status of the Job. *

* * @param status * The status of the Job. * @return Returns a reference to this object so that method calls can be chained together. * @see JobStatus */ public Job withStatus(JobStatus status) { this.status = status.toString(); return this; } /** *

* A list of tags associated with the Job. *

* * @return A list of tags associated with the Job. */ public java.util.Map getTags() { return tags; } /** *

* A list of tags associated with the Job. *

* * @param tags * A list of tags associated with the Job. */ public void setTags(java.util.Map tags) { this.tags = tags; } /** *

* A list of tags associated with the Job. *

* * @param tags * A list of tags associated with the Job. * @return Returns a reference to this object so that method calls can be chained together. */ public Job withTags(java.util.Map tags) { setTags(tags); return this; } /** * Add a single Tags entry * * @see Job#withTags * @returns a reference to this object so that method calls can be chained together. */ public Job addTagsEntry(String key, String value) { if (null == this.tags) { this.tags = new java.util.HashMap(); } if (this.tags.containsKey(key)) throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided."); this.tags.put(key, value); return this; } /** * Removes all the entries added into Tags. * * @return Returns a reference to this object so that method calls can be chained together. */ public Job clearTagsEntries() { this.tags = null; return this; } /** *

* The type of the Job. *

* * @param type * The type of the Job. * @see JobType */ public void setType(String type) { this.type = type; } /** *

* The type of the Job. *

* * @return The type of the Job. * @see JobType */ public String getType() { return this.type; } /** *

* The type of the Job. *

* * @param type * The type of the Job. * @return Returns a reference to this object so that method calls can be chained together. * @see JobType */ public Job withType(String type) { setType(type); return this; } /** *

* The type of the Job. *

* * @param type * The type of the Job. * @return Returns a reference to this object so that method calls can be chained together. * @see JobType */ public Job withType(JobType type) { this.type = type.toString(); 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 (getArn() != null) sb.append("Arn: ").append(getArn()).append(","); if (getCreationDateTime() != null) sb.append("CreationDateTime: ").append(getCreationDateTime()).append(","); if (getEndDateTime() != null) sb.append("EndDateTime: ").append(getEndDateTime()).append(","); if (getInitiatedBy() != null) sb.append("InitiatedBy: ").append(getInitiatedBy()).append(","); if (getJobID() != null) sb.append("JobID: ").append(getJobID()).append(","); if (getParticipatingResources() != null) sb.append("ParticipatingResources: ").append(getParticipatingResources()).append(","); if (getParticipatingServers() != null) sb.append("ParticipatingServers: ").append(getParticipatingServers()).append(","); if (getStatus() != null) sb.append("Status: ").append(getStatus()).append(","); if (getTags() != null) sb.append("Tags: ").append("***Sensitive Data Redacted***").append(","); if (getType() != null) sb.append("Type: ").append(getType()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof Job == false) return false; Job other = (Job) obj; if (other.getArn() == null ^ this.getArn() == null) return false; if (other.getArn() != null && other.getArn().equals(this.getArn()) == false) return false; if (other.getCreationDateTime() == null ^ this.getCreationDateTime() == null) return false; if (other.getCreationDateTime() != null && other.getCreationDateTime().equals(this.getCreationDateTime()) == false) return false; if (other.getEndDateTime() == null ^ this.getEndDateTime() == null) return false; if (other.getEndDateTime() != null && other.getEndDateTime().equals(this.getEndDateTime()) == false) return false; if (other.getInitiatedBy() == null ^ this.getInitiatedBy() == null) return false; if (other.getInitiatedBy() != null && other.getInitiatedBy().equals(this.getInitiatedBy()) == false) return false; if (other.getJobID() == null ^ this.getJobID() == null) return false; if (other.getJobID() != null && other.getJobID().equals(this.getJobID()) == false) return false; if (other.getParticipatingResources() == null ^ this.getParticipatingResources() == null) return false; if (other.getParticipatingResources() != null && other.getParticipatingResources().equals(this.getParticipatingResources()) == false) return false; if (other.getParticipatingServers() == null ^ this.getParticipatingServers() == null) return false; if (other.getParticipatingServers() != null && other.getParticipatingServers().equals(this.getParticipatingServers()) == 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.getTags() == null ^ this.getTags() == null) return false; if (other.getTags() != null && other.getTags().equals(this.getTags()) == false) return false; if (other.getType() == null ^ this.getType() == null) return false; if (other.getType() != null && other.getType().equals(this.getType()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getArn() == null) ? 0 : getArn().hashCode()); hashCode = prime * hashCode + ((getCreationDateTime() == null) ? 0 : getCreationDateTime().hashCode()); hashCode = prime * hashCode + ((getEndDateTime() == null) ? 0 : getEndDateTime().hashCode()); hashCode = prime * hashCode + ((getInitiatedBy() == null) ? 0 : getInitiatedBy().hashCode()); hashCode = prime * hashCode + ((getJobID() == null) ? 0 : getJobID().hashCode()); hashCode = prime * hashCode + ((getParticipatingResources() == null) ? 0 : getParticipatingResources().hashCode()); hashCode = prime * hashCode + ((getParticipatingServers() == null) ? 0 : getParticipatingServers().hashCode()); hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode()); hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); hashCode = prime * hashCode + ((getType() == null) ? 0 : getType().hashCode()); return hashCode; } @Override public Job clone() { try { return (Job) 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.drs.model.transform.JobMarshaller.getInstance().marshall(this, protocolMarshaller); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy