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

software.amazon.awssdk.services.codegurureviewer.model.RecommendationSummary Maven / Gradle / Ivy

Go to download

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

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.codegurureviewer.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;

/**
 * 

* Information about recommendations. *

*/ @Generated("software.amazon.awssdk:codegen") public final class RecommendationSummary implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField FILE_PATH_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("FilePath").getter(getter(RecommendationSummary::filePath)).setter(setter(Builder::filePath)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FilePath").build()).build(); private static final SdkField RECOMMENDATION_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("RecommendationId").getter(getter(RecommendationSummary::recommendationId)) .setter(setter(Builder::recommendationId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RecommendationId").build()).build(); private static final SdkField START_LINE_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("StartLine").getter(getter(RecommendationSummary::startLine)).setter(setter(Builder::startLine)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StartLine").build()).build(); private static final SdkField END_LINE_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("EndLine").getter(getter(RecommendationSummary::endLine)).setter(setter(Builder::endLine)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EndLine").build()).build(); private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("Description").getter(getter(RecommendationSummary::description)).setter(setter(Builder::description)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Description").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(FILE_PATH_FIELD, RECOMMENDATION_ID_FIELD, START_LINE_FIELD, END_LINE_FIELD, DESCRIPTION_FIELD)); private static final long serialVersionUID = 1L; private final String filePath; private final String recommendationId; private final Integer startLine; private final Integer endLine; private final String description; private RecommendationSummary(BuilderImpl builder) { this.filePath = builder.filePath; this.recommendationId = builder.recommendationId; this.startLine = builder.startLine; this.endLine = builder.endLine; this.description = builder.description; } /** *

* Name of the file on which a recommendation is provided. *

* * @return Name of the file on which a recommendation is provided. */ public final String filePath() { return filePath; } /** *

* The recommendation ID that can be used to track the provided recommendations. Later on it can be used to collect * the feedback. *

* * @return The recommendation ID that can be used to track the provided recommendations. Later on it can be used to * collect the feedback. */ public final String recommendationId() { return recommendationId; } /** *

* Start line from where the recommendation is applicable in the source commit or source branch. *

* * @return Start line from where the recommendation is applicable in the source commit or source branch. */ public final Integer startLine() { return startLine; } /** *

* Last line where the recommendation is applicable in the source commit or source branch. For a single line comment * the start line and end line values are the same. *

* * @return Last line where the recommendation is applicable in the source commit or source branch. For a single line * comment the start line and end line values are the same. */ public final Integer endLine() { return endLine; } /** *

* A description of the recommendation generated by CodeGuru Reviewer for the lines of code between the start line * and the end line. *

* * @return A description of the recommendation generated by CodeGuru Reviewer for the lines of code between the * start line and the end line. */ public final String description() { return description; } @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(filePath()); hashCode = 31 * hashCode + Objects.hashCode(recommendationId()); hashCode = 31 * hashCode + Objects.hashCode(startLine()); hashCode = 31 * hashCode + Objects.hashCode(endLine()); hashCode = 31 * hashCode + Objects.hashCode(description()); 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 RecommendationSummary)) { return false; } RecommendationSummary other = (RecommendationSummary) obj; return Objects.equals(filePath(), other.filePath()) && Objects.equals(recommendationId(), other.recommendationId()) && Objects.equals(startLine(), other.startLine()) && Objects.equals(endLine(), other.endLine()) && Objects.equals(description(), other.description()); } /** * 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("RecommendationSummary").add("FilePath", filePath()).add("RecommendationId", recommendationId()) .add("StartLine", startLine()).add("EndLine", endLine()).add("Description", description()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "FilePath": return Optional.ofNullable(clazz.cast(filePath())); case "RecommendationId": return Optional.ofNullable(clazz.cast(recommendationId())); case "StartLine": return Optional.ofNullable(clazz.cast(startLine())); case "EndLine": return Optional.ofNullable(clazz.cast(endLine())); case "Description": return Optional.ofNullable(clazz.cast(description())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((RecommendationSummary) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* Name of the file on which a recommendation is provided. *

* * @param filePath * Name of the file on which a recommendation is provided. * @return Returns a reference to this object so that method calls can be chained together. */ Builder filePath(String filePath); /** *

* The recommendation ID that can be used to track the provided recommendations. Later on it can be used to * collect the feedback. *

* * @param recommendationId * The recommendation ID that can be used to track the provided recommendations. Later on it can be used * to collect the feedback. * @return Returns a reference to this object so that method calls can be chained together. */ Builder recommendationId(String recommendationId); /** *

* Start line from where the recommendation is applicable in the source commit or source branch. *

* * @param startLine * Start line from where the recommendation is applicable in the source commit or source branch. * @return Returns a reference to this object so that method calls can be chained together. */ Builder startLine(Integer startLine); /** *

* Last line where the recommendation is applicable in the source commit or source branch. For a single line * comment the start line and end line values are the same. *

* * @param endLine * Last line where the recommendation is applicable in the source commit or source branch. For a single * line comment the start line and end line values are the same. * @return Returns a reference to this object so that method calls can be chained together. */ Builder endLine(Integer endLine); /** *

* A description of the recommendation generated by CodeGuru Reviewer for the lines of code between the start * line and the end line. *

* * @param description * A description of the recommendation generated by CodeGuru Reviewer for the lines of code between the * start line and the end line. * @return Returns a reference to this object so that method calls can be chained together. */ Builder description(String description); } static final class BuilderImpl implements Builder { private String filePath; private String recommendationId; private Integer startLine; private Integer endLine; private String description; private BuilderImpl() { } private BuilderImpl(RecommendationSummary model) { filePath(model.filePath); recommendationId(model.recommendationId); startLine(model.startLine); endLine(model.endLine); description(model.description); } public final String getFilePath() { return filePath; } @Override public final Builder filePath(String filePath) { this.filePath = filePath; return this; } public final void setFilePath(String filePath) { this.filePath = filePath; } public final String getRecommendationId() { return recommendationId; } @Override public final Builder recommendationId(String recommendationId) { this.recommendationId = recommendationId; return this; } public final void setRecommendationId(String recommendationId) { this.recommendationId = recommendationId; } public final Integer getStartLine() { return startLine; } @Override public final Builder startLine(Integer startLine) { this.startLine = startLine; return this; } public final void setStartLine(Integer startLine) { this.startLine = startLine; } public final Integer getEndLine() { return endLine; } @Override public final Builder endLine(Integer endLine) { this.endLine = endLine; return this; } public final void setEndLine(Integer endLine) { this.endLine = endLine; } public final String getDescription() { return description; } @Override public final Builder description(String description) { this.description = description; return this; } public final void setDescription(String description) { this.description = description; } @Override public RecommendationSummary build() { return new RecommendationSummary(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy