Example usage for com.amazonaws.services.devicefarm.model DevicePool getName

List of usage examples for com.amazonaws.services.devicefarm.model DevicePool getName

Introduction

In this page you can find the example usage for com.amazonaws.services.devicefarm.model DevicePool getName.

Prototype


public String getName() 

Source Link

Document

The device pool's name.

Usage

From source file:org.jenkinsci.plugins.awsdevicefarm.AWSDeviceFarm.java

License:Open Source License

/**
 * Get Device Farm device pool by Device Farm project and device pool name.
 *
 * @param project        The Device Farm project.
 * @param devicePoolName String name of the device pool.
 * @return The Device Farm device pool.//from w w w .  j av  a  2  s .c o m
 * @throws AWSDeviceFarmException
 */
public DevicePool getDevicePool(Project project, String devicePoolName) throws AWSDeviceFarmException {
    List<DevicePool> pools = getDevicePools(project);

    for (DevicePool dp : pools) {
        if (dp.getName().equals(devicePoolName)) {
            return dp;
        }
    }

    throw new AWSDeviceFarmException(String.format("DevicePool '%s' not found.", devicePoolName));
}