com.amazonaws.services.devicefarm.model.DeviceSelectionResult Maven / Gradle / Ivy
Show all versions of aws-java-sdk-devicefarm 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.devicefarm.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Contains the run results requested by the device selection configuration and how many devices were returned. For an
* example of the JSON response syntax, see ScheduleRun.
*
*
* @see AWS
* API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class DeviceSelectionResult implements Serializable, Cloneable, StructuredPojo {
/**
*
* The filters in a device selection result.
*
*/
private java.util.List filters;
/**
*
* The number of devices that matched the device filter selection criteria.
*
*/
private Integer matchedDevicesCount;
/**
*
* The maximum number of devices to be selected by a device filter and included in a test run.
*
*/
private Integer maxDevices;
/**
*
* The filters in a device selection result.
*
*
* @return The filters in a device selection result.
*/
public java.util.List getFilters() {
return filters;
}
/**
*
* The filters in a device selection result.
*
*
* @param filters
* The filters in a device selection result.
*/
public void setFilters(java.util.Collection filters) {
if (filters == null) {
this.filters = null;
return;
}
this.filters = new java.util.ArrayList(filters);
}
/**
*
* The filters in a device selection result.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setFilters(java.util.Collection)} or {@link #withFilters(java.util.Collection)} if you want to override
* the existing values.
*
*
* @param filters
* The filters in a device selection result.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DeviceSelectionResult withFilters(DeviceFilter... filters) {
if (this.filters == null) {
setFilters(new java.util.ArrayList(filters.length));
}
for (DeviceFilter ele : filters) {
this.filters.add(ele);
}
return this;
}
/**
*
* The filters in a device selection result.
*
*
* @param filters
* The filters in a device selection result.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DeviceSelectionResult withFilters(java.util.Collection filters) {
setFilters(filters);
return this;
}
/**
*
* The number of devices that matched the device filter selection criteria.
*
*
* @param matchedDevicesCount
* The number of devices that matched the device filter selection criteria.
*/
public void setMatchedDevicesCount(Integer matchedDevicesCount) {
this.matchedDevicesCount = matchedDevicesCount;
}
/**
*
* The number of devices that matched the device filter selection criteria.
*
*
* @return The number of devices that matched the device filter selection criteria.
*/
public Integer getMatchedDevicesCount() {
return this.matchedDevicesCount;
}
/**
*
* The number of devices that matched the device filter selection criteria.
*
*
* @param matchedDevicesCount
* The number of devices that matched the device filter selection criteria.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DeviceSelectionResult withMatchedDevicesCount(Integer matchedDevicesCount) {
setMatchedDevicesCount(matchedDevicesCount);
return this;
}
/**
*
* The maximum number of devices to be selected by a device filter and included in a test run.
*
*
* @param maxDevices
* The maximum number of devices to be selected by a device filter and included in a test run.
*/
public void setMaxDevices(Integer maxDevices) {
this.maxDevices = maxDevices;
}
/**
*
* The maximum number of devices to be selected by a device filter and included in a test run.
*
*
* @return The maximum number of devices to be selected by a device filter and included in a test run.
*/
public Integer getMaxDevices() {
return this.maxDevices;
}
/**
*
* The maximum number of devices to be selected by a device filter and included in a test run.
*
*
* @param maxDevices
* The maximum number of devices to be selected by a device filter and included in a test run.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DeviceSelectionResult withMaxDevices(Integer maxDevices) {
setMaxDevices(maxDevices);
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 (getFilters() != null)
sb.append("Filters: ").append(getFilters()).append(",");
if (getMatchedDevicesCount() != null)
sb.append("MatchedDevicesCount: ").append(getMatchedDevicesCount()).append(",");
if (getMaxDevices() != null)
sb.append("MaxDevices: ").append(getMaxDevices());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof DeviceSelectionResult == false)
return false;
DeviceSelectionResult other = (DeviceSelectionResult) obj;
if (other.getFilters() == null ^ this.getFilters() == null)
return false;
if (other.getFilters() != null && other.getFilters().equals(this.getFilters()) == false)
return false;
if (other.getMatchedDevicesCount() == null ^ this.getMatchedDevicesCount() == null)
return false;
if (other.getMatchedDevicesCount() != null && other.getMatchedDevicesCount().equals(this.getMatchedDevicesCount()) == false)
return false;
if (other.getMaxDevices() == null ^ this.getMaxDevices() == null)
return false;
if (other.getMaxDevices() != null && other.getMaxDevices().equals(this.getMaxDevices()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getFilters() == null) ? 0 : getFilters().hashCode());
hashCode = prime * hashCode + ((getMatchedDevicesCount() == null) ? 0 : getMatchedDevicesCount().hashCode());
hashCode = prime * hashCode + ((getMaxDevices() == null) ? 0 : getMaxDevices().hashCode());
return hashCode;
}
@Override
public DeviceSelectionResult clone() {
try {
return (DeviceSelectionResult) 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.devicefarm.model.transform.DeviceSelectionResultMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}