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

software.amazon.awssdk.services.codebuild.model.CodeCoverageReportSummary 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.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;

/**
 * 

* Contains a summary of a code coverage report. *

*

* Line coverage measures how many statements your tests cover. A statement is a single instruction, not including * comments, conditionals, etc. *

*

* Branch coverage determines if your tests cover every possible branch of a control structure, such as an * if or case statement. *

*/ @Generated("software.amazon.awssdk:codegen") public final class CodeCoverageReportSummary implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField LINE_COVERAGE_PERCENTAGE_FIELD = SdkField. builder(MarshallingType.DOUBLE) .memberName("lineCoveragePercentage").getter(getter(CodeCoverageReportSummary::lineCoveragePercentage)) .setter(setter(Builder::lineCoveragePercentage)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("lineCoveragePercentage").build()) .build(); private static final SdkField LINES_COVERED_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("linesCovered").getter(getter(CodeCoverageReportSummary::linesCovered)) .setter(setter(Builder::linesCovered)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("linesCovered").build()).build(); private static final SdkField LINES_MISSED_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("linesMissed").getter(getter(CodeCoverageReportSummary::linesMissed)) .setter(setter(Builder::linesMissed)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("linesMissed").build()).build(); private static final SdkField BRANCH_COVERAGE_PERCENTAGE_FIELD = SdkField. builder(MarshallingType.DOUBLE) .memberName("branchCoveragePercentage").getter(getter(CodeCoverageReportSummary::branchCoveragePercentage)) .setter(setter(Builder::branchCoveragePercentage)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("branchCoveragePercentage").build()) .build(); private static final SdkField BRANCHES_COVERED_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("branchesCovered").getter(getter(CodeCoverageReportSummary::branchesCovered)) .setter(setter(Builder::branchesCovered)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("branchesCovered").build()).build(); private static final SdkField BRANCHES_MISSED_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("branchesMissed").getter(getter(CodeCoverageReportSummary::branchesMissed)) .setter(setter(Builder::branchesMissed)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("branchesMissed").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList( LINE_COVERAGE_PERCENTAGE_FIELD, LINES_COVERED_FIELD, LINES_MISSED_FIELD, BRANCH_COVERAGE_PERCENTAGE_FIELD, BRANCHES_COVERED_FIELD, BRANCHES_MISSED_FIELD)); private static final long serialVersionUID = 1L; private final Double lineCoveragePercentage; private final Integer linesCovered; private final Integer linesMissed; private final Double branchCoveragePercentage; private final Integer branchesCovered; private final Integer branchesMissed; private CodeCoverageReportSummary(BuilderImpl builder) { this.lineCoveragePercentage = builder.lineCoveragePercentage; this.linesCovered = builder.linesCovered; this.linesMissed = builder.linesMissed; this.branchCoveragePercentage = builder.branchCoveragePercentage; this.branchesCovered = builder.branchesCovered; this.branchesMissed = builder.branchesMissed; } /** *

* The percentage of lines that are covered by your tests. *

* * @return The percentage of lines that are covered by your tests. */ public final Double lineCoveragePercentage() { return lineCoveragePercentage; } /** *

* The number of lines that are covered by your tests. *

* * @return The number of lines that are covered by your tests. */ public final Integer linesCovered() { return linesCovered; } /** *

* The number of lines that are not covered by your tests. *

* * @return The number of lines that are not covered by your tests. */ public final Integer linesMissed() { return linesMissed; } /** *

* The percentage of branches that are covered by your tests. *

* * @return The percentage of branches that are covered by your tests. */ public final Double branchCoveragePercentage() { return branchCoveragePercentage; } /** *

* The number of conditional branches that are covered by your tests. *

* * @return The number of conditional branches that are covered by your tests. */ public final Integer branchesCovered() { return branchesCovered; } /** *

* The number of conditional branches that are not covered by your tests. *

* * @return The number of conditional branches that are not covered by your tests. */ public final Integer branchesMissed() { return branchesMissed; } @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(lineCoveragePercentage()); hashCode = 31 * hashCode + Objects.hashCode(linesCovered()); hashCode = 31 * hashCode + Objects.hashCode(linesMissed()); hashCode = 31 * hashCode + Objects.hashCode(branchCoveragePercentage()); hashCode = 31 * hashCode + Objects.hashCode(branchesCovered()); hashCode = 31 * hashCode + Objects.hashCode(branchesMissed()); 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 CodeCoverageReportSummary)) { return false; } CodeCoverageReportSummary other = (CodeCoverageReportSummary) obj; return Objects.equals(lineCoveragePercentage(), other.lineCoveragePercentage()) && Objects.equals(linesCovered(), other.linesCovered()) && Objects.equals(linesMissed(), other.linesMissed()) && Objects.equals(branchCoveragePercentage(), other.branchCoveragePercentage()) && Objects.equals(branchesCovered(), other.branchesCovered()) && Objects.equals(branchesMissed(), other.branchesMissed()); } /** * 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("CodeCoverageReportSummary").add("LineCoveragePercentage", lineCoveragePercentage()) .add("LinesCovered", linesCovered()).add("LinesMissed", linesMissed()) .add("BranchCoveragePercentage", branchCoveragePercentage()).add("BranchesCovered", branchesCovered()) .add("BranchesMissed", branchesMissed()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "lineCoveragePercentage": return Optional.ofNullable(clazz.cast(lineCoveragePercentage())); case "linesCovered": return Optional.ofNullable(clazz.cast(linesCovered())); case "linesMissed": return Optional.ofNullable(clazz.cast(linesMissed())); case "branchCoveragePercentage": return Optional.ofNullable(clazz.cast(branchCoveragePercentage())); case "branchesCovered": return Optional.ofNullable(clazz.cast(branchesCovered())); case "branchesMissed": return Optional.ofNullable(clazz.cast(branchesMissed())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((CodeCoverageReportSummary) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The percentage of lines that are covered by your tests. *

* * @param lineCoveragePercentage * The percentage of lines that are covered by your tests. * @return Returns a reference to this object so that method calls can be chained together. */ Builder lineCoveragePercentage(Double lineCoveragePercentage); /** *

* The number of lines that are covered by your tests. *

* * @param linesCovered * The number of lines that are covered by your tests. * @return Returns a reference to this object so that method calls can be chained together. */ Builder linesCovered(Integer linesCovered); /** *

* The number of lines that are not covered by your tests. *

* * @param linesMissed * The number of lines that are not covered by your tests. * @return Returns a reference to this object so that method calls can be chained together. */ Builder linesMissed(Integer linesMissed); /** *

* The percentage of branches that are covered by your tests. *

* * @param branchCoveragePercentage * The percentage of branches that are covered by your tests. * @return Returns a reference to this object so that method calls can be chained together. */ Builder branchCoveragePercentage(Double branchCoveragePercentage); /** *

* The number of conditional branches that are covered by your tests. *

* * @param branchesCovered * The number of conditional branches that are covered by your tests. * @return Returns a reference to this object so that method calls can be chained together. */ Builder branchesCovered(Integer branchesCovered); /** *

* The number of conditional branches that are not covered by your tests. *

* * @param branchesMissed * The number of conditional branches that are not covered by your tests. * @return Returns a reference to this object so that method calls can be chained together. */ Builder branchesMissed(Integer branchesMissed); } static final class BuilderImpl implements Builder { private Double lineCoveragePercentage; private Integer linesCovered; private Integer linesMissed; private Double branchCoveragePercentage; private Integer branchesCovered; private Integer branchesMissed; private BuilderImpl() { } private BuilderImpl(CodeCoverageReportSummary model) { lineCoveragePercentage(model.lineCoveragePercentage); linesCovered(model.linesCovered); linesMissed(model.linesMissed); branchCoveragePercentage(model.branchCoveragePercentage); branchesCovered(model.branchesCovered); branchesMissed(model.branchesMissed); } public final Double getLineCoveragePercentage() { return lineCoveragePercentage; } public final void setLineCoveragePercentage(Double lineCoveragePercentage) { this.lineCoveragePercentage = lineCoveragePercentage; } @Override public final Builder lineCoveragePercentage(Double lineCoveragePercentage) { this.lineCoveragePercentage = lineCoveragePercentage; return this; } public final Integer getLinesCovered() { return linesCovered; } public final void setLinesCovered(Integer linesCovered) { this.linesCovered = linesCovered; } @Override public final Builder linesCovered(Integer linesCovered) { this.linesCovered = linesCovered; return this; } public final Integer getLinesMissed() { return linesMissed; } public final void setLinesMissed(Integer linesMissed) { this.linesMissed = linesMissed; } @Override public final Builder linesMissed(Integer linesMissed) { this.linesMissed = linesMissed; return this; } public final Double getBranchCoveragePercentage() { return branchCoveragePercentage; } public final void setBranchCoveragePercentage(Double branchCoveragePercentage) { this.branchCoveragePercentage = branchCoveragePercentage; } @Override public final Builder branchCoveragePercentage(Double branchCoveragePercentage) { this.branchCoveragePercentage = branchCoveragePercentage; return this; } public final Integer getBranchesCovered() { return branchesCovered; } public final void setBranchesCovered(Integer branchesCovered) { this.branchesCovered = branchesCovered; } @Override public final Builder branchesCovered(Integer branchesCovered) { this.branchesCovered = branchesCovered; return this; } public final Integer getBranchesMissed() { return branchesMissed; } public final void setBranchesMissed(Integer branchesMissed) { this.branchesMissed = branchesMissed; } @Override public final Builder branchesMissed(Integer branchesMissed) { this.branchesMissed = branchesMissed; return this; } @Override public CodeCoverageReportSummary build() { return new CodeCoverageReportSummary(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy