com.amazonaws.services.resourceexplorer2.model.SearchResult Maven / Gradle / Ivy
Show all versions of aws-java-sdk-resourceexplorer2 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.resourceexplorer2.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class SearchResult extends com.amazonaws.AmazonWebServiceResult implements Serializable, Cloneable {
/**
*
* The number of resources that match the query.
*
*/
private ResourceCount count;
/**
*
* If present, indicates that more output is available than is included in the current response. Use this value in
* the NextToken
request parameter in a subsequent call to the operation to get the next part of the
* output. You should repeat this until the NextToken
response element comes back as null
.
* The pagination tokens expire after 24 hours.
*
*/
private String nextToken;
/**
*
* The list of structures that describe the resources that match the query.
*
*/
private java.util.List resources;
/**
*
* The Amazon resource name
* (ARN) of the view that this operation used to perform the search.
*
*/
private String viewArn;
/**
*
* The number of resources that match the query.
*
*
* @param count
* The number of resources that match the query.
*/
public void setCount(ResourceCount count) {
this.count = count;
}
/**
*
* The number of resources that match the query.
*
*
* @return The number of resources that match the query.
*/
public ResourceCount getCount() {
return this.count;
}
/**
*
* The number of resources that match the query.
*
*
* @param count
* The number of resources that match the query.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SearchResult withCount(ResourceCount count) {
setCount(count);
return this;
}
/**
*
* If present, indicates that more output is available than is included in the current response. Use this value in
* the NextToken
request parameter in a subsequent call to the operation to get the next part of the
* output. You should repeat this until the NextToken
response element comes back as null
.
* The pagination tokens expire after 24 hours.
*
*
* @param nextToken
* If present, indicates that more output is available than is included in the current response. Use this
* value in the NextToken
request parameter in a subsequent call to the operation to get the
* next part of the output. You should repeat this until the NextToken
response element comes
* back as null
. The pagination tokens expire after 24 hours.
*/
public void setNextToken(String nextToken) {
this.nextToken = nextToken;
}
/**
*
* If present, indicates that more output is available than is included in the current response. Use this value in
* the NextToken
request parameter in a subsequent call to the operation to get the next part of the
* output. You should repeat this until the NextToken
response element comes back as null
.
* The pagination tokens expire after 24 hours.
*
*
* @return If present, indicates that more output is available than is included in the current response. Use this
* value in the NextToken
request parameter in a subsequent call to the operation to get the
* next part of the output. You should repeat this until the NextToken
response element comes
* back as null
. The pagination tokens expire after 24 hours.
*/
public String getNextToken() {
return this.nextToken;
}
/**
*
* If present, indicates that more output is available than is included in the current response. Use this value in
* the NextToken
request parameter in a subsequent call to the operation to get the next part of the
* output. You should repeat this until the NextToken
response element comes back as null
.
* The pagination tokens expire after 24 hours.
*
*
* @param nextToken
* If present, indicates that more output is available than is included in the current response. Use this
* value in the NextToken
request parameter in a subsequent call to the operation to get the
* next part of the output. You should repeat this until the NextToken
response element comes
* back as null
. The pagination tokens expire after 24 hours.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SearchResult withNextToken(String nextToken) {
setNextToken(nextToken);
return this;
}
/**
*
* The list of structures that describe the resources that match the query.
*
*
* @return The list of structures that describe the resources that match the query.
*/
public java.util.List getResources() {
return resources;
}
/**
*
* The list of structures that describe the resources that match the query.
*
*
* @param resources
* The list of structures that describe the resources that match the query.
*/
public void setResources(java.util.Collection resources) {
if (resources == null) {
this.resources = null;
return;
}
this.resources = new java.util.ArrayList(resources);
}
/**
*
* The list of structures that describe the resources that match the query.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setResources(java.util.Collection)} or {@link #withResources(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param resources
* The list of structures that describe the resources that match the query.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SearchResult withResources(Resource... resources) {
if (this.resources == null) {
setResources(new java.util.ArrayList(resources.length));
}
for (Resource ele : resources) {
this.resources.add(ele);
}
return this;
}
/**
*
* The list of structures that describe the resources that match the query.
*
*
* @param resources
* The list of structures that describe the resources that match the query.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SearchResult withResources(java.util.Collection resources) {
setResources(resources);
return this;
}
/**
*
* The Amazon resource name
* (ARN) of the view that this operation used to perform the search.
*
*
* @param viewArn
* The Amazon resource
* name (ARN) of the view that this operation used to perform the search.
*/
public void setViewArn(String viewArn) {
this.viewArn = viewArn;
}
/**
*
* The Amazon resource name
* (ARN) of the view that this operation used to perform the search.
*
*
* @return The Amazon resource
* name (ARN) of the view that this operation used to perform the search.
*/
public String getViewArn() {
return this.viewArn;
}
/**
*
* The Amazon resource name
* (ARN) of the view that this operation used to perform the search.
*
*
* @param viewArn
* The Amazon resource
* name (ARN) of the view that this operation used to perform the search.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public SearchResult withViewArn(String viewArn) {
setViewArn(viewArn);
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 (getCount() != null)
sb.append("Count: ").append(getCount()).append(",");
if (getNextToken() != null)
sb.append("NextToken: ").append(getNextToken()).append(",");
if (getResources() != null)
sb.append("Resources: ").append(getResources()).append(",");
if (getViewArn() != null)
sb.append("ViewArn: ").append(getViewArn());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof SearchResult == false)
return false;
SearchResult other = (SearchResult) obj;
if (other.getCount() == null ^ this.getCount() == null)
return false;
if (other.getCount() != null && other.getCount().equals(this.getCount()) == false)
return false;
if (other.getNextToken() == null ^ this.getNextToken() == null)
return false;
if (other.getNextToken() != null && other.getNextToken().equals(this.getNextToken()) == false)
return false;
if (other.getResources() == null ^ this.getResources() == null)
return false;
if (other.getResources() != null && other.getResources().equals(this.getResources()) == false)
return false;
if (other.getViewArn() == null ^ this.getViewArn() == null)
return false;
if (other.getViewArn() != null && other.getViewArn().equals(this.getViewArn()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getCount() == null) ? 0 : getCount().hashCode());
hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode());
hashCode = prime * hashCode + ((getResources() == null) ? 0 : getResources().hashCode());
hashCode = prime * hashCode + ((getViewArn() == null) ? 0 : getViewArn().hashCode());
return hashCode;
}
@Override
public SearchResult clone() {
try {
return (SearchResult) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}