All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.devicefarm.model.Device Maven / Gradle / Ivy

Go to download

The AWS Java SDK for AWS Device Farm module holds the client classes that are used for communicating with AWS Device Farm

There is a newer version: 2.29.39
Show newest version
/*
 * Copyright 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 software.amazon.awssdk.services.devicefarm.model;

import java.io.Serializable;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* Represents a device type that an app is tested against. *

*/ @Generated("software.amazon.awssdk:codegen") public final class Device implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField ARN_FIELD = SdkField. builder(MarshallingType.STRING).memberName("arn") .getter(getter(Device::arn)).setter(setter(Builder::arn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("arn").build()).build(); private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("name") .getter(getter(Device::name)).setter(setter(Builder::name)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("name").build()).build(); private static final SdkField MANUFACTURER_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("manufacturer").getter(getter(Device::manufacturer)).setter(setter(Builder::manufacturer)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("manufacturer").build()).build(); private static final SdkField MODEL_FIELD = SdkField. builder(MarshallingType.STRING).memberName("model") .getter(getter(Device::model)).setter(setter(Builder::model)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("model").build()).build(); private static final SdkField MODEL_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("modelId").getter(getter(Device::modelId)).setter(setter(Builder::modelId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("modelId").build()).build(); private static final SdkField FORM_FACTOR_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("formFactor").getter(getter(Device::formFactorAsString)).setter(setter(Builder::formFactor)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("formFactor").build()).build(); private static final SdkField PLATFORM_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("platform").getter(getter(Device::platformAsString)).setter(setter(Builder::platform)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("platform").build()).build(); private static final SdkField OS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("os") .getter(getter(Device::os)).setter(setter(Builder::os)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("os").build()).build(); private static final SdkField CPU_FIELD = SdkField. builder(MarshallingType.SDK_POJO).memberName("cpu") .getter(getter(Device::cpu)).setter(setter(Builder::cpu)).constructor(CPU::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("cpu").build()).build(); private static final SdkField RESOLUTION_FIELD = SdkField. builder(MarshallingType.SDK_POJO) .memberName("resolution").getter(getter(Device::resolution)).setter(setter(Builder::resolution)) .constructor(Resolution::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("resolution").build()).build(); private static final SdkField HEAP_SIZE_FIELD = SdkField. builder(MarshallingType.LONG).memberName("heapSize") .getter(getter(Device::heapSize)).setter(setter(Builder::heapSize)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("heapSize").build()).build(); private static final SdkField MEMORY_FIELD = SdkField. builder(MarshallingType.LONG).memberName("memory") .getter(getter(Device::memory)).setter(setter(Builder::memory)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("memory").build()).build(); private static final SdkField IMAGE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("image") .getter(getter(Device::image)).setter(setter(Builder::image)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("image").build()).build(); private static final SdkField CARRIER_FIELD = SdkField. builder(MarshallingType.STRING).memberName("carrier") .getter(getter(Device::carrier)).setter(setter(Builder::carrier)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("carrier").build()).build(); private static final SdkField RADIO_FIELD = SdkField. builder(MarshallingType.STRING).memberName("radio") .getter(getter(Device::radio)).setter(setter(Builder::radio)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("radio").build()).build(); private static final SdkField REMOTE_ACCESS_ENABLED_FIELD = SdkField. builder(MarshallingType.BOOLEAN) .memberName("remoteAccessEnabled").getter(getter(Device::remoteAccessEnabled)) .setter(setter(Builder::remoteAccessEnabled)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("remoteAccessEnabled").build()) .build(); private static final SdkField REMOTE_DEBUG_ENABLED_FIELD = SdkField. builder(MarshallingType.BOOLEAN) .memberName("remoteDebugEnabled").getter(getter(Device::remoteDebugEnabled)) .setter(setter(Builder::remoteDebugEnabled)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("remoteDebugEnabled").build()) .build(); private static final SdkField FLEET_TYPE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("fleetType").getter(getter(Device::fleetType)).setter(setter(Builder::fleetType)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("fleetType").build()).build(); private static final SdkField FLEET_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("fleetName").getter(getter(Device::fleetName)).setter(setter(Builder::fleetName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("fleetName").build()).build(); private static final SdkField> INSTANCES_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("instances") .getter(getter(Device::instances)) .setter(setter(Builder::instances)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("instances").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(DeviceInstance::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField AVAILABILITY_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("availability").getter(getter(Device::availabilityAsString)).setter(setter(Builder::availability)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("availability").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ARN_FIELD, NAME_FIELD, MANUFACTURER_FIELD, MODEL_FIELD, MODEL_ID_FIELD, FORM_FACTOR_FIELD, PLATFORM_FIELD, OS_FIELD, CPU_FIELD, RESOLUTION_FIELD, HEAP_SIZE_FIELD, MEMORY_FIELD, IMAGE_FIELD, CARRIER_FIELD, RADIO_FIELD, REMOTE_ACCESS_ENABLED_FIELD, REMOTE_DEBUG_ENABLED_FIELD, FLEET_TYPE_FIELD, FLEET_NAME_FIELD, INSTANCES_FIELD, AVAILABILITY_FIELD)); private static final long serialVersionUID = 1L; private final String arn; private final String name; private final String manufacturer; private final String model; private final String modelId; private final String formFactor; private final String platform; private final String os; private final CPU cpu; private final Resolution resolution; private final Long heapSize; private final Long memory; private final String image; private final String carrier; private final String radio; private final Boolean remoteAccessEnabled; private final Boolean remoteDebugEnabled; private final String fleetType; private final String fleetName; private final List instances; private final String availability; private Device(BuilderImpl builder) { this.arn = builder.arn; this.name = builder.name; this.manufacturer = builder.manufacturer; this.model = builder.model; this.modelId = builder.modelId; this.formFactor = builder.formFactor; this.platform = builder.platform; this.os = builder.os; this.cpu = builder.cpu; this.resolution = builder.resolution; this.heapSize = builder.heapSize; this.memory = builder.memory; this.image = builder.image; this.carrier = builder.carrier; this.radio = builder.radio; this.remoteAccessEnabled = builder.remoteAccessEnabled; this.remoteDebugEnabled = builder.remoteDebugEnabled; this.fleetType = builder.fleetType; this.fleetName = builder.fleetName; this.instances = builder.instances; this.availability = builder.availability; } /** *

* The device's ARN. *

* * @return The device's ARN. */ public final String arn() { return arn; } /** *

* The device's display name. *

* * @return The device's display name. */ public final String name() { return name; } /** *

* The device's manufacturer name. *

* * @return The device's manufacturer name. */ public final String manufacturer() { return manufacturer; } /** *

* The device's model name. *

* * @return The device's model name. */ public final String model() { return model; } /** *

* The device's model ID. *

* * @return The device's model ID. */ public final String modelId() { return modelId; } /** *

* The device's form factor. *

*

* Allowed values include: *

*
    *
  • *

    * PHONE *

    *
  • *
  • *

    * TABLET *

    *
  • *
*

* If the service returns an enum value that is not available in the current SDK version, {@link #formFactor} will * return {@link DeviceFormFactor#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #formFactorAsString}. *

* * @return The device's form factor.

*

* Allowed values include: *

*
    *
  • *

    * PHONE *

    *
  • *
  • *

    * TABLET *

    *
  • * @see DeviceFormFactor */ public final DeviceFormFactor formFactor() { return DeviceFormFactor.fromValue(formFactor); } /** *

    * The device's form factor. *

    *

    * Allowed values include: *

    *
      *
    • *

      * PHONE *

      *
    • *
    • *

      * TABLET *

      *
    • *
    *

    * If the service returns an enum value that is not available in the current SDK version, {@link #formFactor} will * return {@link DeviceFormFactor#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #formFactorAsString}. *

    * * @return The device's form factor.

    *

    * Allowed values include: *

    *
      *
    • *

      * PHONE *

      *
    • *
    • *

      * TABLET *

      *
    • * @see DeviceFormFactor */ public final String formFactorAsString() { return formFactor; } /** *

      * The device's platform. *

      *

      * Allowed values include: *

      *
        *
      • *

        * ANDROID *

        *
      • *
      • *

        * IOS *

        *
      • *
      *

      * If the service returns an enum value that is not available in the current SDK version, {@link #platform} will * return {@link DevicePlatform#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #platformAsString}. *

      * * @return The device's platform.

      *

      * Allowed values include: *

      *
        *
      • *

        * ANDROID *

        *
      • *
      • *

        * IOS *

        *
      • * @see DevicePlatform */ public final DevicePlatform platform() { return DevicePlatform.fromValue(platform); } /** *

        * The device's platform. *

        *

        * Allowed values include: *

        *
          *
        • *

          * ANDROID *

          *
        • *
        • *

          * IOS *

          *
        • *
        *

        * If the service returns an enum value that is not available in the current SDK version, {@link #platform} will * return {@link DevicePlatform#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #platformAsString}. *

        * * @return The device's platform.

        *

        * Allowed values include: *

        *
          *
        • *

          * ANDROID *

          *
        • *
        • *

          * IOS *

          *
        • * @see DevicePlatform */ public final String platformAsString() { return platform; } /** *

          * The device's operating system type. *

          * * @return The device's operating system type. */ public final String os() { return os; } /** *

          * Information about the device's CPU. *

          * * @return Information about the device's CPU. */ public final CPU cpu() { return cpu; } /** *

          * The resolution of the device. *

          * * @return The resolution of the device. */ public final Resolution resolution() { return resolution; } /** *

          * The device's heap size, expressed in bytes. *

          * * @return The device's heap size, expressed in bytes. */ public final Long heapSize() { return heapSize; } /** *

          * The device's total memory size, expressed in bytes. *

          * * @return The device's total memory size, expressed in bytes. */ public final Long memory() { return memory; } /** *

          * The device's image name. *

          * * @return The device's image name. */ public final String image() { return image; } /** *

          * The device's carrier. *

          * * @return The device's carrier. */ public final String carrier() { return carrier; } /** *

          * The device's radio. *

          * * @return The device's radio. */ public final String radio() { return radio; } /** *

          * Specifies whether remote access has been enabled for the specified device. *

          * * @return Specifies whether remote access has been enabled for the specified device. */ public final Boolean remoteAccessEnabled() { return remoteAccessEnabled; } /** *

          * This flag is set to true if remote debugging is enabled for the device. *

          *

          * Remote debugging is no longer * supported. *

          * * @return This flag is set to true if remote debugging is enabled for the device.

          *

          * Remote debugging is no longer supported. */ public final Boolean remoteDebugEnabled() { return remoteDebugEnabled; } /** *

          * The type of fleet to which this device belongs. Possible values are PRIVATE and PUBLIC. *

          * * @return The type of fleet to which this device belongs. Possible values are PRIVATE and PUBLIC. */ public final String fleetType() { return fleetType; } /** *

          * The name of the fleet to which this device belongs. *

          * * @return The name of the fleet to which this device belongs. */ public final String fleetName() { return fleetName; } /** * For responses, this returns true if the service returned a value for the Instances property. This DOES NOT check * that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is * useful because the SDK will never return a null collection or map, but you may need to differentiate between the * service returning nothing (or null) and the service returning an empty collection or map. For requests, this * returns true if a value for the property was specified in the request builder, and false if a value was not * specified. */ public final boolean hasInstances() { return instances != null && !(instances instanceof SdkAutoConstructList); } /** *

          * The instances that belong to this device. *

          *

          * Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

          *

          * This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasInstances} method. *

          * * @return The instances that belong to this device. */ public final List instances() { return instances; } /** *

          * Indicates how likely a device is available for a test run. Currently available in the ListDevices and * GetDevice API methods. *

          *

          * If the service returns an enum value that is not available in the current SDK version, {@link #availability} will * return {@link DeviceAvailability#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #availabilityAsString}. *

          * * @return Indicates how likely a device is available for a test run. Currently available in the ListDevices * and GetDevice API methods. * @see DeviceAvailability */ public final DeviceAvailability availability() { return DeviceAvailability.fromValue(availability); } /** *

          * Indicates how likely a device is available for a test run. Currently available in the ListDevices and * GetDevice API methods. *

          *

          * If the service returns an enum value that is not available in the current SDK version, {@link #availability} will * return {@link DeviceAvailability#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #availabilityAsString}. *

          * * @return Indicates how likely a device is available for a test run. Currently available in the ListDevices * and GetDevice API methods. * @see DeviceAvailability */ public final String availabilityAsString() { return availability; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(arn()); hashCode = 31 * hashCode + Objects.hashCode(name()); hashCode = 31 * hashCode + Objects.hashCode(manufacturer()); hashCode = 31 * hashCode + Objects.hashCode(model()); hashCode = 31 * hashCode + Objects.hashCode(modelId()); hashCode = 31 * hashCode + Objects.hashCode(formFactorAsString()); hashCode = 31 * hashCode + Objects.hashCode(platformAsString()); hashCode = 31 * hashCode + Objects.hashCode(os()); hashCode = 31 * hashCode + Objects.hashCode(cpu()); hashCode = 31 * hashCode + Objects.hashCode(resolution()); hashCode = 31 * hashCode + Objects.hashCode(heapSize()); hashCode = 31 * hashCode + Objects.hashCode(memory()); hashCode = 31 * hashCode + Objects.hashCode(image()); hashCode = 31 * hashCode + Objects.hashCode(carrier()); hashCode = 31 * hashCode + Objects.hashCode(radio()); hashCode = 31 * hashCode + Objects.hashCode(remoteAccessEnabled()); hashCode = 31 * hashCode + Objects.hashCode(remoteDebugEnabled()); hashCode = 31 * hashCode + Objects.hashCode(fleetType()); hashCode = 31 * hashCode + Objects.hashCode(fleetName()); hashCode = 31 * hashCode + Objects.hashCode(hasInstances() ? instances() : null); hashCode = 31 * hashCode + Objects.hashCode(availabilityAsString()); return hashCode; } @Override public final boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof Device)) { return false; } Device other = (Device) obj; return Objects.equals(arn(), other.arn()) && Objects.equals(name(), other.name()) && Objects.equals(manufacturer(), other.manufacturer()) && Objects.equals(model(), other.model()) && Objects.equals(modelId(), other.modelId()) && Objects.equals(formFactorAsString(), other.formFactorAsString()) && Objects.equals(platformAsString(), other.platformAsString()) && Objects.equals(os(), other.os()) && Objects.equals(cpu(), other.cpu()) && Objects.equals(resolution(), other.resolution()) && Objects.equals(heapSize(), other.heapSize()) && Objects.equals(memory(), other.memory()) && Objects.equals(image(), other.image()) && Objects.equals(carrier(), other.carrier()) && Objects.equals(radio(), other.radio()) && Objects.equals(remoteAccessEnabled(), other.remoteAccessEnabled()) && Objects.equals(remoteDebugEnabled(), other.remoteDebugEnabled()) && Objects.equals(fleetType(), other.fleetType()) && Objects.equals(fleetName(), other.fleetName()) && hasInstances() == other.hasInstances() && Objects.equals(instances(), other.instances()) && Objects.equals(availabilityAsString(), other.availabilityAsString()); } /** * 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. */ @Override public final String toString() { return ToString.builder("Device").add("Arn", arn()).add("Name", name()).add("Manufacturer", manufacturer()) .add("Model", model()).add("ModelId", modelId()).add("FormFactor", formFactorAsString()) .add("Platform", platformAsString()).add("Os", os()).add("Cpu", cpu()).add("Resolution", resolution()) .add("HeapSize", heapSize()).add("Memory", memory()).add("Image", image()).add("Carrier", carrier()) .add("Radio", radio()).add("RemoteAccessEnabled", remoteAccessEnabled()) .add("RemoteDebugEnabled", remoteDebugEnabled()).add("FleetType", fleetType()).add("FleetName", fleetName()) .add("Instances", hasInstances() ? instances() : null).add("Availability", availabilityAsString()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "arn": return Optional.ofNullable(clazz.cast(arn())); case "name": return Optional.ofNullable(clazz.cast(name())); case "manufacturer": return Optional.ofNullable(clazz.cast(manufacturer())); case "model": return Optional.ofNullable(clazz.cast(model())); case "modelId": return Optional.ofNullable(clazz.cast(modelId())); case "formFactor": return Optional.ofNullable(clazz.cast(formFactorAsString())); case "platform": return Optional.ofNullable(clazz.cast(platformAsString())); case "os": return Optional.ofNullable(clazz.cast(os())); case "cpu": return Optional.ofNullable(clazz.cast(cpu())); case "resolution": return Optional.ofNullable(clazz.cast(resolution())); case "heapSize": return Optional.ofNullable(clazz.cast(heapSize())); case "memory": return Optional.ofNullable(clazz.cast(memory())); case "image": return Optional.ofNullable(clazz.cast(image())); case "carrier": return Optional.ofNullable(clazz.cast(carrier())); case "radio": return Optional.ofNullable(clazz.cast(radio())); case "remoteAccessEnabled": return Optional.ofNullable(clazz.cast(remoteAccessEnabled())); case "remoteDebugEnabled": return Optional.ofNullable(clazz.cast(remoteDebugEnabled())); case "fleetType": return Optional.ofNullable(clazz.cast(fleetType())); case "fleetName": return Optional.ofNullable(clazz.cast(fleetName())); case "instances": return Optional.ofNullable(clazz.cast(instances())); case "availability": return Optional.ofNullable(clazz.cast(availabilityAsString())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((Device) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

          * The device's ARN. *

          * * @param arn * The device's ARN. * @return Returns a reference to this object so that method calls can be chained together. */ Builder arn(String arn); /** *

          * The device's display name. *

          * * @param name * The device's display name. * @return Returns a reference to this object so that method calls can be chained together. */ Builder name(String name); /** *

          * The device's manufacturer name. *

          * * @param manufacturer * The device's manufacturer name. * @return Returns a reference to this object so that method calls can be chained together. */ Builder manufacturer(String manufacturer); /** *

          * The device's model name. *

          * * @param model * The device's model name. * @return Returns a reference to this object so that method calls can be chained together. */ Builder model(String model); /** *

          * The device's model ID. *

          * * @param modelId * The device's model ID. * @return Returns a reference to this object so that method calls can be chained together. */ Builder modelId(String modelId); /** *

          * The device's form factor. *

          *

          * Allowed values include: *

          *
            *
          • *

            * PHONE *

            *
          • *
          • *

            * TABLET *

            *
          • *
          * * @param formFactor * The device's form factor.

          *

          * Allowed values include: *

          *
            *
          • *

            * PHONE *

            *
          • *
          • *

            * TABLET *

            *
          • * @see DeviceFormFactor * @return Returns a reference to this object so that method calls can be chained together. * @see DeviceFormFactor */ Builder formFactor(String formFactor); /** *

            * The device's form factor. *

            *

            * Allowed values include: *

            *
              *
            • *

              * PHONE *

              *
            • *
            • *

              * TABLET *

              *
            • *
            * * @param formFactor * The device's form factor.

            *

            * Allowed values include: *

            *
              *
            • *

              * PHONE *

              *
            • *
            • *

              * TABLET *

              *
            • * @see DeviceFormFactor * @return Returns a reference to this object so that method calls can be chained together. * @see DeviceFormFactor */ Builder formFactor(DeviceFormFactor formFactor); /** *

              * The device's platform. *

              *

              * Allowed values include: *

              *
                *
              • *

                * ANDROID *

                *
              • *
              • *

                * IOS *

                *
              • *
              * * @param platform * The device's platform.

              *

              * Allowed values include: *

              *
                *
              • *

                * ANDROID *

                *
              • *
              • *

                * IOS *

                *
              • * @see DevicePlatform * @return Returns a reference to this object so that method calls can be chained together. * @see DevicePlatform */ Builder platform(String platform); /** *

                * The device's platform. *

                *

                * Allowed values include: *

                *
                  *
                • *

                  * ANDROID *

                  *
                • *
                • *

                  * IOS *

                  *
                • *
                * * @param platform * The device's platform.

                *

                * Allowed values include: *

                *
                  *
                • *

                  * ANDROID *

                  *
                • *
                • *

                  * IOS *

                  *
                • * @see DevicePlatform * @return Returns a reference to this object so that method calls can be chained together. * @see DevicePlatform */ Builder platform(DevicePlatform platform); /** *

                  * The device's operating system type. *

                  * * @param os * The device's operating system type. * @return Returns a reference to this object so that method calls can be chained together. */ Builder os(String os); /** *

                  * Information about the device's CPU. *

                  * * @param cpu * Information about the device's CPU. * @return Returns a reference to this object so that method calls can be chained together. */ Builder cpu(CPU cpu); /** *

                  * Information about the device's CPU. *

                  * This is a convenience method that creates an instance of the {@link CPU.Builder} avoiding the need to create * one manually via {@link CPU#builder()}. * *

                  * When the {@link Consumer} completes, {@link CPU.Builder#build()} is called immediately and its result is * passed to {@link #cpu(CPU)}. * * @param cpu * a consumer that will call methods on {@link CPU.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #cpu(CPU) */ default Builder cpu(Consumer cpu) { return cpu(CPU.builder().applyMutation(cpu).build()); } /** *

                  * The resolution of the device. *

                  * * @param resolution * The resolution of the device. * @return Returns a reference to this object so that method calls can be chained together. */ Builder resolution(Resolution resolution); /** *

                  * The resolution of the device. *

                  * This is a convenience method that creates an instance of the {@link Resolution.Builder} avoiding the need to * create one manually via {@link Resolution#builder()}. * *

                  * When the {@link Consumer} completes, {@link Resolution.Builder#build()} is called immediately and its result * is passed to {@link #resolution(Resolution)}. * * @param resolution * a consumer that will call methods on {@link Resolution.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #resolution(Resolution) */ default Builder resolution(Consumer resolution) { return resolution(Resolution.builder().applyMutation(resolution).build()); } /** *

                  * The device's heap size, expressed in bytes. *

                  * * @param heapSize * The device's heap size, expressed in bytes. * @return Returns a reference to this object so that method calls can be chained together. */ Builder heapSize(Long heapSize); /** *

                  * The device's total memory size, expressed in bytes. *

                  * * @param memory * The device's total memory size, expressed in bytes. * @return Returns a reference to this object so that method calls can be chained together. */ Builder memory(Long memory); /** *

                  * The device's image name. *

                  * * @param image * The device's image name. * @return Returns a reference to this object so that method calls can be chained together. */ Builder image(String image); /** *

                  * The device's carrier. *

                  * * @param carrier * The device's carrier. * @return Returns a reference to this object so that method calls can be chained together. */ Builder carrier(String carrier); /** *

                  * The device's radio. *

                  * * @param radio * The device's radio. * @return Returns a reference to this object so that method calls can be chained together. */ Builder radio(String radio); /** *

                  * Specifies whether remote access has been enabled for the specified device. *

                  * * @param remoteAccessEnabled * Specifies whether remote access has been enabled for the specified device. * @return Returns a reference to this object so that method calls can be chained together. */ Builder remoteAccessEnabled(Boolean remoteAccessEnabled); /** *

                  * This flag is set to true if remote debugging is enabled for the device. *

                  *

                  * Remote debugging is no * longer supported. *

                  * * @param remoteDebugEnabled * This flag is set to true if remote debugging is enabled for the device.

                  *

                  * Remote debugging is no longer * supported. * @return Returns a reference to this object so that method calls can be chained together. */ Builder remoteDebugEnabled(Boolean remoteDebugEnabled); /** *

                  * The type of fleet to which this device belongs. Possible values are PRIVATE and PUBLIC. *

                  * * @param fleetType * The type of fleet to which this device belongs. Possible values are PRIVATE and PUBLIC. * @return Returns a reference to this object so that method calls can be chained together. */ Builder fleetType(String fleetType); /** *

                  * The name of the fleet to which this device belongs. *

                  * * @param fleetName * The name of the fleet to which this device belongs. * @return Returns a reference to this object so that method calls can be chained together. */ Builder fleetName(String fleetName); /** *

                  * The instances that belong to this device. *

                  * * @param instances * The instances that belong to this device. * @return Returns a reference to this object so that method calls can be chained together. */ Builder instances(Collection instances); /** *

                  * The instances that belong to this device. *

                  * * @param instances * The instances that belong to this device. * @return Returns a reference to this object so that method calls can be chained together. */ Builder instances(DeviceInstance... instances); /** *

                  * The instances that belong to this device. *

                  * This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.devicefarm.model.DeviceInstance.Builder} avoiding the need to create * one manually via {@link software.amazon.awssdk.services.devicefarm.model.DeviceInstance#builder()}. * *

                  * When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.devicefarm.model.DeviceInstance.Builder#build()} is called immediately * and its result is passed to {@link #instances(List)}. * * @param instances * a consumer that will call methods on * {@link software.amazon.awssdk.services.devicefarm.model.DeviceInstance.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #instances(java.util.Collection) */ Builder instances(Consumer... instances); /** *

                  * Indicates how likely a device is available for a test run. Currently available in the ListDevices and * GetDevice API methods. *

                  * * @param availability * Indicates how likely a device is available for a test run. Currently available in the * ListDevices and GetDevice API methods. * @see DeviceAvailability * @return Returns a reference to this object so that method calls can be chained together. * @see DeviceAvailability */ Builder availability(String availability); /** *

                  * Indicates how likely a device is available for a test run. Currently available in the ListDevices and * GetDevice API methods. *

                  * * @param availability * Indicates how likely a device is available for a test run. Currently available in the * ListDevices and GetDevice API methods. * @see DeviceAvailability * @return Returns a reference to this object so that method calls can be chained together. * @see DeviceAvailability */ Builder availability(DeviceAvailability availability); } static final class BuilderImpl implements Builder { private String arn; private String name; private String manufacturer; private String model; private String modelId; private String formFactor; private String platform; private String os; private CPU cpu; private Resolution resolution; private Long heapSize; private Long memory; private String image; private String carrier; private String radio; private Boolean remoteAccessEnabled; private Boolean remoteDebugEnabled; private String fleetType; private String fleetName; private List instances = DefaultSdkAutoConstructList.getInstance(); private String availability; private BuilderImpl() { } private BuilderImpl(Device model) { arn(model.arn); name(model.name); manufacturer(model.manufacturer); model(model.model); modelId(model.modelId); formFactor(model.formFactor); platform(model.platform); os(model.os); cpu(model.cpu); resolution(model.resolution); heapSize(model.heapSize); memory(model.memory); image(model.image); carrier(model.carrier); radio(model.radio); remoteAccessEnabled(model.remoteAccessEnabled); remoteDebugEnabled(model.remoteDebugEnabled); fleetType(model.fleetType); fleetName(model.fleetName); instances(model.instances); availability(model.availability); } public final String getArn() { return arn; } public final void setArn(String arn) { this.arn = arn; } @Override public final Builder arn(String arn) { this.arn = arn; return this; } public final String getName() { return name; } public final void setName(String name) { this.name = name; } @Override public final Builder name(String name) { this.name = name; return this; } public final String getManufacturer() { return manufacturer; } public final void setManufacturer(String manufacturer) { this.manufacturer = manufacturer; } @Override public final Builder manufacturer(String manufacturer) { this.manufacturer = manufacturer; return this; } public final String getModel() { return model; } public final void setModel(String model) { this.model = model; } @Override public final Builder model(String model) { this.model = model; return this; } public final String getModelId() { return modelId; } public final void setModelId(String modelId) { this.modelId = modelId; } @Override public final Builder modelId(String modelId) { this.modelId = modelId; return this; } public final String getFormFactor() { return formFactor; } public final void setFormFactor(String formFactor) { this.formFactor = formFactor; } @Override public final Builder formFactor(String formFactor) { this.formFactor = formFactor; return this; } @Override public final Builder formFactor(DeviceFormFactor formFactor) { this.formFactor(formFactor == null ? null : formFactor.toString()); return this; } public final String getPlatform() { return platform; } public final void setPlatform(String platform) { this.platform = platform; } @Override public final Builder platform(String platform) { this.platform = platform; return this; } @Override public final Builder platform(DevicePlatform platform) { this.platform(platform == null ? null : platform.toString()); return this; } public final String getOs() { return os; } public final void setOs(String os) { this.os = os; } @Override public final Builder os(String os) { this.os = os; return this; } public final CPU.Builder getCpu() { return cpu != null ? cpu.toBuilder() : null; } public final void setCpu(CPU.BuilderImpl cpu) { this.cpu = cpu != null ? cpu.build() : null; } @Override public final Builder cpu(CPU cpu) { this.cpu = cpu; return this; } public final Resolution.Builder getResolution() { return resolution != null ? resolution.toBuilder() : null; } public final void setResolution(Resolution.BuilderImpl resolution) { this.resolution = resolution != null ? resolution.build() : null; } @Override public final Builder resolution(Resolution resolution) { this.resolution = resolution; return this; } public final Long getHeapSize() { return heapSize; } public final void setHeapSize(Long heapSize) { this.heapSize = heapSize; } @Override public final Builder heapSize(Long heapSize) { this.heapSize = heapSize; return this; } public final Long getMemory() { return memory; } public final void setMemory(Long memory) { this.memory = memory; } @Override public final Builder memory(Long memory) { this.memory = memory; return this; } public final String getImage() { return image; } public final void setImage(String image) { this.image = image; } @Override public final Builder image(String image) { this.image = image; return this; } public final String getCarrier() { return carrier; } public final void setCarrier(String carrier) { this.carrier = carrier; } @Override public final Builder carrier(String carrier) { this.carrier = carrier; return this; } public final String getRadio() { return radio; } public final void setRadio(String radio) { this.radio = radio; } @Override public final Builder radio(String radio) { this.radio = radio; return this; } public final Boolean getRemoteAccessEnabled() { return remoteAccessEnabled; } public final void setRemoteAccessEnabled(Boolean remoteAccessEnabled) { this.remoteAccessEnabled = remoteAccessEnabled; } @Override public final Builder remoteAccessEnabled(Boolean remoteAccessEnabled) { this.remoteAccessEnabled = remoteAccessEnabled; return this; } public final Boolean getRemoteDebugEnabled() { return remoteDebugEnabled; } public final void setRemoteDebugEnabled(Boolean remoteDebugEnabled) { this.remoteDebugEnabled = remoteDebugEnabled; } @Override public final Builder remoteDebugEnabled(Boolean remoteDebugEnabled) { this.remoteDebugEnabled = remoteDebugEnabled; return this; } public final String getFleetType() { return fleetType; } public final void setFleetType(String fleetType) { this.fleetType = fleetType; } @Override public final Builder fleetType(String fleetType) { this.fleetType = fleetType; return this; } public final String getFleetName() { return fleetName; } public final void setFleetName(String fleetName) { this.fleetName = fleetName; } @Override public final Builder fleetName(String fleetName) { this.fleetName = fleetName; return this; } public final List getInstances() { List result = DeviceInstancesCopier.copyToBuilder(this.instances); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setInstances(Collection instances) { this.instances = DeviceInstancesCopier.copyFromBuilder(instances); } @Override public final Builder instances(Collection instances) { this.instances = DeviceInstancesCopier.copy(instances); return this; } @Override @SafeVarargs public final Builder instances(DeviceInstance... instances) { instances(Arrays.asList(instances)); return this; } @Override @SafeVarargs public final Builder instances(Consumer... instances) { instances(Stream.of(instances).map(c -> DeviceInstance.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } public final String getAvailability() { return availability; } public final void setAvailability(String availability) { this.availability = availability; } @Override public final Builder availability(String availability) { this.availability = availability; return this; } @Override public final Builder availability(DeviceAvailability availability) { this.availability(availability == null ? null : availability.toString()); return this; } @Override public Device build() { return new Device(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy