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

software.amazon.awssdk.services.devicefarm.model.Counters 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.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
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.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* Represents entity counters. *

*/ @Generated("software.amazon.awssdk:codegen") public final class Counters implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField TOTAL_FIELD = SdkField. builder(MarshallingType.INTEGER).memberName("total") .getter(getter(Counters::total)).setter(setter(Builder::total)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("total").build()).build(); private static final SdkField PASSED_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("passed").getter(getter(Counters::passed)).setter(setter(Builder::passed)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("passed").build()).build(); private static final SdkField FAILED_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("failed").getter(getter(Counters::failed)).setter(setter(Builder::failed)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("failed").build()).build(); private static final SdkField WARNED_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("warned").getter(getter(Counters::warned)).setter(setter(Builder::warned)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("warned").build()).build(); private static final SdkField ERRORED_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("errored").getter(getter(Counters::errored)).setter(setter(Builder::errored)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("errored").build()).build(); private static final SdkField STOPPED_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("stopped").getter(getter(Counters::stopped)).setter(setter(Builder::stopped)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("stopped").build()).build(); private static final SdkField SKIPPED_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("skipped").getter(getter(Counters::skipped)).setter(setter(Builder::skipped)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("skipped").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(TOTAL_FIELD, PASSED_FIELD, FAILED_FIELD, WARNED_FIELD, ERRORED_FIELD, STOPPED_FIELD, SKIPPED_FIELD)); private static final long serialVersionUID = 1L; private final Integer total; private final Integer passed; private final Integer failed; private final Integer warned; private final Integer errored; private final Integer stopped; private final Integer skipped; private Counters(BuilderImpl builder) { this.total = builder.total; this.passed = builder.passed; this.failed = builder.failed; this.warned = builder.warned; this.errored = builder.errored; this.stopped = builder.stopped; this.skipped = builder.skipped; } /** *

* The total number of entities. *

* * @return The total number of entities. */ public Integer total() { return total; } /** *

* The number of passed entities. *

* * @return The number of passed entities. */ public Integer passed() { return passed; } /** *

* The number of failed entities. *

* * @return The number of failed entities. */ public Integer failed() { return failed; } /** *

* The number of warned entities. *

* * @return The number of warned entities. */ public Integer warned() { return warned; } /** *

* The number of errored entities. *

* * @return The number of errored entities. */ public Integer errored() { return errored; } /** *

* The number of stopped entities. *

* * @return The number of stopped entities. */ public Integer stopped() { return stopped; } /** *

* The number of skipped entities. *

* * @return The number of skipped entities. */ public Integer skipped() { return skipped; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(total()); hashCode = 31 * hashCode + Objects.hashCode(passed()); hashCode = 31 * hashCode + Objects.hashCode(failed()); hashCode = 31 * hashCode + Objects.hashCode(warned()); hashCode = 31 * hashCode + Objects.hashCode(errored()); hashCode = 31 * hashCode + Objects.hashCode(stopped()); hashCode = 31 * hashCode + Objects.hashCode(skipped()); return hashCode; } @Override public boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof Counters)) { return false; } Counters other = (Counters) obj; return Objects.equals(total(), other.total()) && Objects.equals(passed(), other.passed()) && Objects.equals(failed(), other.failed()) && Objects.equals(warned(), other.warned()) && Objects.equals(errored(), other.errored()) && Objects.equals(stopped(), other.stopped()) && Objects.equals(skipped(), other.skipped()); } /** * 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 String toString() { return ToString.builder("Counters").add("Total", total()).add("Passed", passed()).add("Failed", failed()) .add("Warned", warned()).add("Errored", errored()).add("Stopped", stopped()).add("Skipped", skipped()).build(); } public Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "total": return Optional.ofNullable(clazz.cast(total())); case "passed": return Optional.ofNullable(clazz.cast(passed())); case "failed": return Optional.ofNullable(clazz.cast(failed())); case "warned": return Optional.ofNullable(clazz.cast(warned())); case "errored": return Optional.ofNullable(clazz.cast(errored())); case "stopped": return Optional.ofNullable(clazz.cast(stopped())); case "skipped": return Optional.ofNullable(clazz.cast(skipped())); default: return Optional.empty(); } } @Override public List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((Counters) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The total number of entities. *

* * @param total * The total number of entities. * @return Returns a reference to this object so that method calls can be chained together. */ Builder total(Integer total); /** *

* The number of passed entities. *

* * @param passed * The number of passed entities. * @return Returns a reference to this object so that method calls can be chained together. */ Builder passed(Integer passed); /** *

* The number of failed entities. *

* * @param failed * The number of failed entities. * @return Returns a reference to this object so that method calls can be chained together. */ Builder failed(Integer failed); /** *

* The number of warned entities. *

* * @param warned * The number of warned entities. * @return Returns a reference to this object so that method calls can be chained together. */ Builder warned(Integer warned); /** *

* The number of errored entities. *

* * @param errored * The number of errored entities. * @return Returns a reference to this object so that method calls can be chained together. */ Builder errored(Integer errored); /** *

* The number of stopped entities. *

* * @param stopped * The number of stopped entities. * @return Returns a reference to this object so that method calls can be chained together. */ Builder stopped(Integer stopped); /** *

* The number of skipped entities. *

* * @param skipped * The number of skipped entities. * @return Returns a reference to this object so that method calls can be chained together. */ Builder skipped(Integer skipped); } static final class BuilderImpl implements Builder { private Integer total; private Integer passed; private Integer failed; private Integer warned; private Integer errored; private Integer stopped; private Integer skipped; private BuilderImpl() { } private BuilderImpl(Counters model) { total(model.total); passed(model.passed); failed(model.failed); warned(model.warned); errored(model.errored); stopped(model.stopped); skipped(model.skipped); } public final Integer getTotal() { return total; } @Override public final Builder total(Integer total) { this.total = total; return this; } public final void setTotal(Integer total) { this.total = total; } public final Integer getPassed() { return passed; } @Override public final Builder passed(Integer passed) { this.passed = passed; return this; } public final void setPassed(Integer passed) { this.passed = passed; } public final Integer getFailed() { return failed; } @Override public final Builder failed(Integer failed) { this.failed = failed; return this; } public final void setFailed(Integer failed) { this.failed = failed; } public final Integer getWarned() { return warned; } @Override public final Builder warned(Integer warned) { this.warned = warned; return this; } public final void setWarned(Integer warned) { this.warned = warned; } public final Integer getErrored() { return errored; } @Override public final Builder errored(Integer errored) { this.errored = errored; return this; } public final void setErrored(Integer errored) { this.errored = errored; } public final Integer getStopped() { return stopped; } @Override public final Builder stopped(Integer stopped) { this.stopped = stopped; return this; } public final void setStopped(Integer stopped) { this.stopped = stopped; } public final Integer getSkipped() { return skipped; } @Override public final Builder skipped(Integer skipped) { this.skipped = skipped; return this; } public final void setSkipped(Integer skipped) { this.skipped = skipped; } @Override public Counters build() { return new Counters(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy