com.google.gerrit.server.comment.AutoValue_CommentContextLoader_ContextInput Maven / Gradle / Ivy
The newest version!
package com.google.gerrit.server.comment;
import com.google.gerrit.common.Nullable;
import com.google.gerrit.entities.Comment;
import javax.annotation.processing.Generated;
import org.eclipse.jgit.lib.ObjectId;
@Generated("com.google.auto.value.processor.AutoValueProcessor")
final class AutoValue_CommentContextLoader_ContextInput extends CommentContextLoader.ContextInput {
private final ObjectId commitId;
private final String filePath;
@Nullable
private final Comment.Range range;
private final int lineNumber;
private final int contextPadding;
private AutoValue_CommentContextLoader_ContextInput(
ObjectId commitId,
String filePath,
@Nullable Comment.Range range,
int lineNumber,
int contextPadding) {
this.commitId = commitId;
this.filePath = filePath;
this.range = range;
this.lineNumber = lineNumber;
this.contextPadding = contextPadding;
}
@Override
ObjectId commitId() {
return commitId;
}
@Override
String filePath() {
return filePath;
}
@Nullable
@Override
Comment.Range range() {
return range;
}
@Override
int lineNumber() {
return lineNumber;
}
@Override
int contextPadding() {
return contextPadding;
}
@Override
public String toString() {
return "ContextInput{"
+ "commitId=" + commitId + ", "
+ "filePath=" + filePath + ", "
+ "range=" + range + ", "
+ "lineNumber=" + lineNumber + ", "
+ "contextPadding=" + contextPadding
+ "}";
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof CommentContextLoader.ContextInput) {
CommentContextLoader.ContextInput that = (CommentContextLoader.ContextInput) o;
return this.commitId.equals(that.commitId())
&& this.filePath.equals(that.filePath())
&& (this.range == null ? that.range() == null : this.range.equals(that.range()))
&& this.lineNumber == that.lineNumber()
&& this.contextPadding == that.contextPadding();
}
return false;
}
@Override
public int hashCode() {
int h$ = 1;
h$ *= 1000003;
h$ ^= commitId.hashCode();
h$ *= 1000003;
h$ ^= filePath.hashCode();
h$ *= 1000003;
h$ ^= (range == null) ? 0 : range.hashCode();
h$ *= 1000003;
h$ ^= lineNumber;
h$ *= 1000003;
h$ ^= contextPadding;
return h$;
}
static final class Builder extends CommentContextLoader.ContextInput.Builder {
private ObjectId commitId;
private String filePath;
private Comment.Range range;
private int lineNumber;
private int contextPadding;
private byte set$0;
Builder() {
}
@Override
public CommentContextLoader.ContextInput.Builder commitId(ObjectId commitId) {
if (commitId == null) {
throw new NullPointerException("Null commitId");
}
this.commitId = commitId;
return this;
}
@Override
public CommentContextLoader.ContextInput.Builder filePath(String filePath) {
if (filePath == null) {
throw new NullPointerException("Null filePath");
}
this.filePath = filePath;
return this;
}
@Override
public CommentContextLoader.ContextInput.Builder range(@Nullable Comment.Range range) {
this.range = range;
return this;
}
@Override
public CommentContextLoader.ContextInput.Builder lineNumber(int lineNumber) {
this.lineNumber = lineNumber;
set$0 |= (byte) 1;
return this;
}
@Override
public CommentContextLoader.ContextInput.Builder contextPadding(int contextPadding) {
this.contextPadding = contextPadding;
set$0 |= (byte) 2;
return this;
}
@Override
public CommentContextLoader.ContextInput build() {
if (set$0 != 3
|| this.commitId == null
|| this.filePath == null) {
StringBuilder missing = new StringBuilder();
if (this.commitId == null) {
missing.append(" commitId");
}
if (this.filePath == null) {
missing.append(" filePath");
}
if ((set$0 & 1) == 0) {
missing.append(" lineNumber");
}
if ((set$0 & 2) == 0) {
missing.append(" contextPadding");
}
throw new IllegalStateException("Missing required properties:" + missing);
}
return new AutoValue_CommentContextLoader_ContextInput(
this.commitId,
this.filePath,
this.range,
this.lineNumber,
this.contextPadding);
}
}
}