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

software.amazon.awssdk.services.codebuild.model.TestReportSummary Maven / Gradle / Ivy

Go to download

The AWS Java SDK for AWS Code Build module holds the client classes that are used for communicating with AWS Code Build.

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.codebuild.model;

import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
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.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* Information about a test report. *

*/ @Generated("software.amazon.awssdk:codegen") public final class TestReportSummary implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField TOTAL_FIELD = SdkField. builder(MarshallingType.INTEGER) .getter(getter(TestReportSummary::total)).setter(setter(Builder::total)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("total").build()).build(); private static final SdkField> STATUS_COUNTS_FIELD = SdkField .> builder(MarshallingType.MAP) .getter(getter(TestReportSummary::statusCounts)) .setter(setter(Builder::statusCounts)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("statusCounts").build(), MapTrait.builder() .keyLocationName("key") .valueLocationName("value") .valueFieldInfo( SdkField. builder(MarshallingType.INTEGER) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("value").build()).build()).build()).build(); private static final SdkField DURATION_IN_NANO_SECONDS_FIELD = SdkField. builder(MarshallingType.LONG) .getter(getter(TestReportSummary::durationInNanoSeconds)).setter(setter(Builder::durationInNanoSeconds)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("durationInNanoSeconds").build()) .build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(TOTAL_FIELD, STATUS_COUNTS_FIELD, DURATION_IN_NANO_SECONDS_FIELD)); private static final long serialVersionUID = 1L; private final Integer total; private final Map statusCounts; private final Long durationInNanoSeconds; private TestReportSummary(BuilderImpl builder) { this.total = builder.total; this.statusCounts = builder.statusCounts; this.durationInNanoSeconds = builder.durationInNanoSeconds; } /** *

* The number of test cases in this TestReportSummary. The total includes truncated test cases. *

* * @return The number of test cases in this TestReportSummary. The total includes truncated test cases. */ public Integer total() { return total; } /** * Returns true if the StatusCounts property was specified by the sender (it may be empty), or false if the sender * did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service. */ public boolean hasStatusCounts() { return statusCounts != null && !(statusCounts instanceof SdkAutoConstructMap); } /** *

* A map that contains the number of each type of status returned by the test results in this * TestReportSummary. *

*

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

*

* You can use {@link #hasStatusCounts()} to see if a value was sent in this field. *

* * @return A map that contains the number of each type of status returned by the test results in this * TestReportSummary. */ public Map statusCounts() { return statusCounts; } /** *

* The number of nanoseconds it took to run all of the test cases in this report. *

* * @return The number of nanoseconds it took to run all of the test cases in this report. */ public Long durationInNanoSeconds() { return durationInNanoSeconds; } @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(statusCounts()); hashCode = 31 * hashCode + Objects.hashCode(durationInNanoSeconds()); 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 TestReportSummary)) { return false; } TestReportSummary other = (TestReportSummary) obj; return Objects.equals(total(), other.total()) && Objects.equals(statusCounts(), other.statusCounts()) && Objects.equals(durationInNanoSeconds(), other.durationInNanoSeconds()); } /** * 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("TestReportSummary").add("Total", total()).add("StatusCounts", statusCounts()) .add("DurationInNanoSeconds", durationInNanoSeconds()).build(); } public Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "total": return Optional.ofNullable(clazz.cast(total())); case "statusCounts": return Optional.ofNullable(clazz.cast(statusCounts())); case "durationInNanoSeconds": return Optional.ofNullable(clazz.cast(durationInNanoSeconds())); default: return Optional.empty(); } } @Override public List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((TestReportSummary) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The number of test cases in this TestReportSummary. The total includes truncated test cases. *

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

* A map that contains the number of each type of status returned by the test results in this * TestReportSummary. *

* * @param statusCounts * A map that contains the number of each type of status returned by the test results in this * TestReportSummary. * @return Returns a reference to this object so that method calls can be chained together. */ Builder statusCounts(Map statusCounts); /** *

* The number of nanoseconds it took to run all of the test cases in this report. *

* * @param durationInNanoSeconds * The number of nanoseconds it took to run all of the test cases in this report. * @return Returns a reference to this object so that method calls can be chained together. */ Builder durationInNanoSeconds(Long durationInNanoSeconds); } static final class BuilderImpl implements Builder { private Integer total; private Map statusCounts = DefaultSdkAutoConstructMap.getInstance(); private Long durationInNanoSeconds; private BuilderImpl() { } private BuilderImpl(TestReportSummary model) { total(model.total); statusCounts(model.statusCounts); durationInNanoSeconds(model.durationInNanoSeconds); } 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 Map getStatusCounts() { return statusCounts; } @Override public final Builder statusCounts(Map statusCounts) { this.statusCounts = ReportStatusCountsCopier.copy(statusCounts); return this; } public final void setStatusCounts(Map statusCounts) { this.statusCounts = ReportStatusCountsCopier.copy(statusCounts); } public final Long getDurationInNanoSeconds() { return durationInNanoSeconds; } @Override public final Builder durationInNanoSeconds(Long durationInNanoSeconds) { this.durationInNanoSeconds = durationInNanoSeconds; return this; } public final void setDurationInNanoSeconds(Long durationInNanoSeconds) { this.durationInNanoSeconds = durationInNanoSeconds; } @Override public TestReportSummary build() { return new TestReportSummary(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy