com.amazonaws.services.deadline.model.SearchWorkersResult Maven / Gradle / Ivy
Show all versions of aws-java-sdk-deadline Show documentation
/*
* Copyright 2019-2024 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.deadline.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class SearchWorkersResult extends com.amazonaws.AmazonWebServiceResult implements Serializable, Cloneable {
/**
*
* The next incremental starting point after the defined itemOffset
.
*
*/
private Integer nextItemOffset;
/**
*
* The total number of results in the search.
*
*/
private Integer totalResults;
/**
*
* The workers for the search.
*
*/
private java.util.List workers;
/**
*
* The next incremental starting point after the defined itemOffset
.
*
*
* @param nextItemOffset
* The next incremental starting point after the defined itemOffset
.
*/
public void setNextItemOffset(Integer nextItemOffset) {
this.nextItemOffset = nextItemOffset;
}
/**
*
* The next incremental starting point after the defined itemOffset
.
*
*
* @return The next incremental starting point after the defined itemOffset
.
*/
public Integer getNextItemOffset() {
return this.nextItemOffset;
}
/**
*
* The next incremental starting point after the defined itemOffset
.
*
*
* @param nextItemOffset
* The next incremental starting point after the defined itemOffset
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SearchWorkersResult withNextItemOffset(Integer nextItemOffset) {
setNextItemOffset(nextItemOffset);
return this;
}
/**
*
* The total number of results in the search.
*
*
* @param totalResults
* The total number of results in the search.
*/
public void setTotalResults(Integer totalResults) {
this.totalResults = totalResults;
}
/**
*
* The total number of results in the search.
*
*
* @return The total number of results in the search.
*/
public Integer getTotalResults() {
return this.totalResults;
}
/**
*
* The total number of results in the search.
*
*
* @param totalResults
* The total number of results in the search.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SearchWorkersResult withTotalResults(Integer totalResults) {
setTotalResults(totalResults);
return this;
}
/**
*
* The workers for the search.
*
*
* @return The workers for the search.
*/
public java.util.List getWorkers() {
return workers;
}
/**
*
* The workers for the search.
*
*
* @param workers
* The workers for the search.
*/
public void setWorkers(java.util.Collection workers) {
if (workers == null) {
this.workers = null;
return;
}
this.workers = new java.util.ArrayList(workers);
}
/**
*
* The workers for the search.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setWorkers(java.util.Collection)} or {@link #withWorkers(java.util.Collection)} if you want to override
* the existing values.
*
*
* @param workers
* The workers for the search.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SearchWorkersResult withWorkers(WorkerSearchSummary... workers) {
if (this.workers == null) {
setWorkers(new java.util.ArrayList(workers.length));
}
for (WorkerSearchSummary ele : workers) {
this.workers.add(ele);
}
return this;
}
/**
*
* The workers for the search.
*
*
* @param workers
* The workers for the search.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SearchWorkersResult withWorkers(java.util.Collection workers) {
setWorkers(workers);
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 (getNextItemOffset() != null)
sb.append("NextItemOffset: ").append(getNextItemOffset()).append(",");
if (getTotalResults() != null)
sb.append("TotalResults: ").append(getTotalResults()).append(",");
if (getWorkers() != null)
sb.append("Workers: ").append(getWorkers());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof SearchWorkersResult == false)
return false;
SearchWorkersResult other = (SearchWorkersResult) obj;
if (other.getNextItemOffset() == null ^ this.getNextItemOffset() == null)
return false;
if (other.getNextItemOffset() != null && other.getNextItemOffset().equals(this.getNextItemOffset()) == false)
return false;
if (other.getTotalResults() == null ^ this.getTotalResults() == null)
return false;
if (other.getTotalResults() != null && other.getTotalResults().equals(this.getTotalResults()) == false)
return false;
if (other.getWorkers() == null ^ this.getWorkers() == null)
return false;
if (other.getWorkers() != null && other.getWorkers().equals(this.getWorkers()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getNextItemOffset() == null) ? 0 : getNextItemOffset().hashCode());
hashCode = prime * hashCode + ((getTotalResults() == null) ? 0 : getTotalResults().hashCode());
hashCode = prime * hashCode + ((getWorkers() == null) ? 0 : getWorkers().hashCode());
return hashCode;
}
@Override
public SearchWorkersResult clone() {
try {
return (SearchWorkersResult) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}