
com.amazonaws.services.iot.model.AssociateTargetsWithJobRequest Maven / Gradle / Ivy
/*
* Copyright 2015-2020 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.iot.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AssociateTargetsWithJobRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* A list of thing group ARNs that define the targets of the job.
*
*/
private java.util.List targets;
/**
*
* The unique identifier you assigned to this job when it was created.
*
*/
private String jobId;
/**
*
* An optional comment string describing why the job was associated with the targets.
*
*/
private String comment;
/**
*
* A list of thing group ARNs that define the targets of the job.
*
*
* @return A list of thing group ARNs that define the targets of the job.
*/
public java.util.List getTargets() {
return targets;
}
/**
*
* A list of thing group ARNs that define the targets of the job.
*
*
* @param targets
* A list of thing group ARNs that define the targets of the job.
*/
public void setTargets(java.util.Collection targets) {
if (targets == null) {
this.targets = null;
return;
}
this.targets = new java.util.ArrayList(targets);
}
/**
*
* A list of thing group ARNs that define the targets of the job.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setTargets(java.util.Collection)} or {@link #withTargets(java.util.Collection)} if you want to override
* the existing values.
*
*
* @param targets
* A list of thing group ARNs that define the targets of the job.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AssociateTargetsWithJobRequest withTargets(String... targets) {
if (this.targets == null) {
setTargets(new java.util.ArrayList(targets.length));
}
for (String ele : targets) {
this.targets.add(ele);
}
return this;
}
/**
*
* A list of thing group ARNs that define the targets of the job.
*
*
* @param targets
* A list of thing group ARNs that define the targets of the job.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AssociateTargetsWithJobRequest withTargets(java.util.Collection targets) {
setTargets(targets);
return this;
}
/**
*
* The unique identifier you assigned to this job when it was created.
*
*
* @param jobId
* The unique identifier you assigned to this job when it was created.
*/
public void setJobId(String jobId) {
this.jobId = jobId;
}
/**
*
* The unique identifier you assigned to this job when it was created.
*
*
* @return The unique identifier you assigned to this job when it was created.
*/
public String getJobId() {
return this.jobId;
}
/**
*
* The unique identifier you assigned to this job when it was created.
*
*
* @param jobId
* The unique identifier you assigned to this job when it was created.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AssociateTargetsWithJobRequest withJobId(String jobId) {
setJobId(jobId);
return this;
}
/**
*
* An optional comment string describing why the job was associated with the targets.
*
*
* @param comment
* An optional comment string describing why the job was associated with the targets.
*/
public void setComment(String comment) {
this.comment = comment;
}
/**
*
* An optional comment string describing why the job was associated with the targets.
*
*
* @return An optional comment string describing why the job was associated with the targets.
*/
public String getComment() {
return this.comment;
}
/**
*
* An optional comment string describing why the job was associated with the targets.
*
*
* @param comment
* An optional comment string describing why the job was associated with the targets.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AssociateTargetsWithJobRequest withComment(String comment) {
setComment(comment);
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 (getTargets() != null)
sb.append("Targets: ").append(getTargets()).append(",");
if (getJobId() != null)
sb.append("JobId: ").append(getJobId()).append(",");
if (getComment() != null)
sb.append("Comment: ").append(getComment());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof AssociateTargetsWithJobRequest == false)
return false;
AssociateTargetsWithJobRequest other = (AssociateTargetsWithJobRequest) obj;
if (other.getTargets() == null ^ this.getTargets() == null)
return false;
if (other.getTargets() != null && other.getTargets().equals(this.getTargets()) == 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.getComment() == null ^ this.getComment() == null)
return false;
if (other.getComment() != null && other.getComment().equals(this.getComment()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getTargets() == null) ? 0 : getTargets().hashCode());
hashCode = prime * hashCode + ((getJobId() == null) ? 0 : getJobId().hashCode());
hashCode = prime * hashCode + ((getComment() == null) ? 0 : getComment().hashCode());
return hashCode;
}
@Override
public AssociateTargetsWithJobRequest clone() {
return (AssociateTargetsWithJobRequest) super.clone();
}
}