com.amazonaws.services.codegurureviewer.model.RecommendationSummary Maven / Gradle / Ivy
Show all versions of aws-java-sdk-codegurureviewer Show documentation
/*
* Copyright 2016-2021 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 com.amazonaws.services.codegurureviewer.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Information about recommendations.
*
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class RecommendationSummary implements Serializable, Cloneable, StructuredPojo {
/**
*
* Name of the file on which a recommendation is provided.
*
*/
private String filePath;
/**
*
* The recommendation ID that can be used to track the provided recommendations. Later on it can be used to collect
* the feedback.
*
*/
private String recommendationId;
/**
*
* Start line from where the recommendation is applicable in the source commit or source branch.
*
*/
private 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.
*
*/
private Integer endLine;
/**
*
* A description of the recommendation generated by CodeGuru Reviewer for the lines of code between the start line
* and the end line.
*
*/
private String description;
/**
*
* Name of the file on which a recommendation is provided.
*
*
* @param filePath
* Name of the file on which a recommendation is provided.
*/
public void setFilePath(String filePath) {
this.filePath = filePath;
}
/**
*
* Name of the file on which a recommendation is provided.
*
*
* @return Name of the file on which a recommendation is provided.
*/
public String getFilePath() {
return this.filePath;
}
/**
*
* 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.
*/
public RecommendationSummary withFilePath(String filePath) {
setFilePath(filePath);
return this;
}
/**
*
* 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.
*/
public void setRecommendationId(String recommendationId) {
this.recommendationId = recommendationId;
}
/**
*
* 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 String getRecommendationId() {
return this.recommendationId;
}
/**
*
* 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.
*/
public RecommendationSummary withRecommendationId(String recommendationId) {
setRecommendationId(recommendationId);
return this;
}
/**
*
* 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.
*/
public void setStartLine(Integer startLine) {
this.startLine = startLine;
}
/**
*
* 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 Integer getStartLine() {
return this.startLine;
}
/**
*
* 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.
*/
public RecommendationSummary withStartLine(Integer startLine) {
setStartLine(startLine);
return this;
}
/**
*
* 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.
*/
public void setEndLine(Integer endLine) {
this.endLine = 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 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 Integer getEndLine() {
return this.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.
*
*
* @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.
*/
public RecommendationSummary withEndLine(Integer endLine) {
setEndLine(endLine);
return this;
}
/**
*
* 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.
*/
public void setDescription(String description) {
this.description = description;
}
/**
*
* 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 String getDescription() {
return this.description;
}
/**
*
* 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.
*/
public RecommendationSummary withDescription(String description) {
setDescription(description);
return this;
}
/**
* 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.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getFilePath() != null)
sb.append("FilePath: ").append(getFilePath()).append(",");
if (getRecommendationId() != null)
sb.append("RecommendationId: ").append(getRecommendationId()).append(",");
if (getStartLine() != null)
sb.append("StartLine: ").append(getStartLine()).append(",");
if (getEndLine() != null)
sb.append("EndLine: ").append(getEndLine()).append(",");
if (getDescription() != null)
sb.append("Description: ").append(getDescription());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof RecommendationSummary == false)
return false;
RecommendationSummary other = (RecommendationSummary) obj;
if (other.getFilePath() == null ^ this.getFilePath() == null)
return false;
if (other.getFilePath() != null && other.getFilePath().equals(this.getFilePath()) == false)
return false;
if (other.getRecommendationId() == null ^ this.getRecommendationId() == null)
return false;
if (other.getRecommendationId() != null && other.getRecommendationId().equals(this.getRecommendationId()) == false)
return false;
if (other.getStartLine() == null ^ this.getStartLine() == null)
return false;
if (other.getStartLine() != null && other.getStartLine().equals(this.getStartLine()) == false)
return false;
if (other.getEndLine() == null ^ this.getEndLine() == null)
return false;
if (other.getEndLine() != null && other.getEndLine().equals(this.getEndLine()) == false)
return false;
if (other.getDescription() == null ^ this.getDescription() == null)
return false;
if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getFilePath() == null) ? 0 : getFilePath().hashCode());
hashCode = prime * hashCode + ((getRecommendationId() == null) ? 0 : getRecommendationId().hashCode());
hashCode = prime * hashCode + ((getStartLine() == null) ? 0 : getStartLine().hashCode());
hashCode = prime * hashCode + ((getEndLine() == null) ? 0 : getEndLine().hashCode());
hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode());
return hashCode;
}
@Override
public RecommendationSummary clone() {
try {
return (RecommendationSummary) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.codegurureviewer.model.transform.RecommendationSummaryMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}