com.amazonaws.services.iot.model.ListTargetsForPolicyResult Maven / Gradle / Ivy
Show all versions of aws-android-sdk-iot Show documentation
/*
* Copyright 2010-2018 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;
public class ListTargetsForPolicyResult implements Serializable {
/**
*
* The policy targets.
*
*/
private java.util.List targets;
/**
*
* A marker used to get the next set of results.
*
*
* Constraints:
* Pattern: [A-Za-z0-9+/]+={0,2}
*/
private String nextMarker;
/**
*
* The policy targets.
*
*
* @return
* The policy targets.
*
*/
public java.util.List getTargets() {
return targets;
}
/**
*
* The policy targets.
*
*
* @param targets
* The policy targets.
*
*/
public void setTargets(java.util.Collection targets) {
if (targets == null) {
this.targets = null;
return;
}
this.targets = new java.util.ArrayList(targets);
}
/**
*
* The policy targets.
*
*
* Returns a reference to this object so that method calls can be chained
* together.
*
* @param targets
* The policy targets.
*
* @return A reference to this updated object so that method calls can be
* chained together.
*/
public ListTargetsForPolicyResult withTargets(String... targets) {
if (getTargets() == null) {
this.targets = new java.util.ArrayList(targets.length);
}
for (String value : targets) {
this.targets.add(value);
}
return this;
}
/**
*
* The policy targets.
*
*
* Returns a reference to this object so that method calls can be chained
* together.
*
* @param targets
* The policy targets.
*
* @return A reference to this updated object so that method calls can be
* chained together.
*/
public ListTargetsForPolicyResult withTargets(java.util.Collection targets) {
setTargets(targets);
return this;
}
/**
*
* A marker used to get the next set of results.
*
*
* Constraints:
* Pattern: [A-Za-z0-9+/]+={0,2}
*
* @return
* A marker used to get the next set of results.
*
*/
public String getNextMarker() {
return nextMarker;
}
/**
*
* A marker used to get the next set of results.
*
*
* Constraints:
* Pattern: [A-Za-z0-9+/]+={0,2}
*
* @param nextMarker
* A marker used to get the next set of results.
*
*/
public void setNextMarker(String nextMarker) {
this.nextMarker = nextMarker;
}
/**
*
* A marker used to get the next set of results.
*
*
* Returns a reference to this object so that method calls can be chained
* together.
*
* Constraints:
* Pattern: [A-Za-z0-9+/]+={0,2}
*
* @param nextMarker
* A marker used to get the next set of results.
*
* @return A reference to this updated object so that method calls can be
* chained together.
*/
public ListTargetsForPolicyResult withNextMarker(String nextMarker) {
this.nextMarker = nextMarker;
return this;
}
/**
* Returns a string representation of this object; useful for testing and
* debugging.
*
* @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: " + getTargets() + ",");
if (getNextMarker() != null)
sb.append("nextMarker: " + getNextMarker());
sb.append("}");
return sb.toString();
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getTargets() == null) ? 0 : getTargets().hashCode());
hashCode = prime * hashCode + ((getNextMarker() == null) ? 0 : getNextMarker().hashCode());
return hashCode;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ListTargetsForPolicyResult == false)
return false;
ListTargetsForPolicyResult other = (ListTargetsForPolicyResult) obj;
if (other.getTargets() == null ^ this.getTargets() == null)
return false;
if (other.getTargets() != null && other.getTargets().equals(this.getTargets()) == false)
return false;
if (other.getNextMarker() == null ^ this.getNextMarker() == null)
return false;
if (other.getNextMarker() != null
&& other.getNextMarker().equals(this.getNextMarker()) == false)
return false;
return true;
}
}