com.google.gerrit.server.patch.filediff.AutoValue_FileDiffCacheKey Maven / Gradle / Ivy
package com.google.gerrit.server.patch.filediff;
import com.google.gerrit.entities.Project;
import com.google.gerrit.extensions.client.DiffPreferencesInfo;
import com.google.gerrit.server.patch.gitfilediff.GitFileDiffCacheImpl;
import javax.annotation.processing.Generated;
import org.eclipse.jgit.lib.ObjectId;
@Generated("com.google.auto.value.processor.AutoValueProcessor")
final class AutoValue_FileDiffCacheKey extends FileDiffCacheKey {
private final Project.NameKey project;
private final ObjectId oldCommit;
private final ObjectId newCommit;
private final String newFilePath;
private final int renameScore;
private final GitFileDiffCacheImpl.DiffAlgorithm diffAlgorithm;
private final DiffPreferencesInfo.Whitespace whitespace;
private final boolean useTimeout;
private AutoValue_FileDiffCacheKey(
Project.NameKey project,
ObjectId oldCommit,
ObjectId newCommit,
String newFilePath,
int renameScore,
GitFileDiffCacheImpl.DiffAlgorithm diffAlgorithm,
DiffPreferencesInfo.Whitespace whitespace,
boolean useTimeout) {
this.project = project;
this.oldCommit = oldCommit;
this.newCommit = newCommit;
this.newFilePath = newFilePath;
this.renameScore = renameScore;
this.diffAlgorithm = diffAlgorithm;
this.whitespace = whitespace;
this.useTimeout = useTimeout;
}
@Override
public Project.NameKey project() {
return project;
}
@Override
public ObjectId oldCommit() {
return oldCommit;
}
@Override
public ObjectId newCommit() {
return newCommit;
}
@Override
public String newFilePath() {
return newFilePath;
}
@Override
public int renameScore() {
return renameScore;
}
@Override
public GitFileDiffCacheImpl.DiffAlgorithm diffAlgorithm() {
return diffAlgorithm;
}
@Override
public DiffPreferencesInfo.Whitespace whitespace() {
return whitespace;
}
@Override
public boolean useTimeout() {
return useTimeout;
}
@Override
public String toString() {
return "FileDiffCacheKey{"
+ "project=" + project + ", "
+ "oldCommit=" + oldCommit + ", "
+ "newCommit=" + newCommit + ", "
+ "newFilePath=" + newFilePath + ", "
+ "renameScore=" + renameScore + ", "
+ "diffAlgorithm=" + diffAlgorithm + ", "
+ "whitespace=" + whitespace + ", "
+ "useTimeout=" + useTimeout
+ "}";
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof FileDiffCacheKey) {
FileDiffCacheKey that = (FileDiffCacheKey) o;
return this.project.equals(that.project())
&& this.oldCommit.equals(that.oldCommit())
&& this.newCommit.equals(that.newCommit())
&& this.newFilePath.equals(that.newFilePath())
&& this.renameScore == that.renameScore()
&& this.diffAlgorithm.equals(that.diffAlgorithm())
&& this.whitespace.equals(that.whitespace())
&& this.useTimeout == that.useTimeout();
}
return false;
}
@Override
public int hashCode() {
int h$ = 1;
h$ *= 1000003;
h$ ^= project.hashCode();
h$ *= 1000003;
h$ ^= oldCommit.hashCode();
h$ *= 1000003;
h$ ^= newCommit.hashCode();
h$ *= 1000003;
h$ ^= newFilePath.hashCode();
h$ *= 1000003;
h$ ^= renameScore;
h$ *= 1000003;
h$ ^= diffAlgorithm.hashCode();
h$ *= 1000003;
h$ ^= whitespace.hashCode();
h$ *= 1000003;
h$ ^= useTimeout ? 1231 : 1237;
return h$;
}
@Override
public FileDiffCacheKey.Builder toBuilder() {
return new Builder(this);
}
static final class Builder extends FileDiffCacheKey.Builder {
private Project.NameKey project;
private ObjectId oldCommit;
private ObjectId newCommit;
private String newFilePath;
private Integer renameScore;
private GitFileDiffCacheImpl.DiffAlgorithm diffAlgorithm;
private DiffPreferencesInfo.Whitespace whitespace;
private Boolean useTimeout;
Builder() {
}
private Builder(FileDiffCacheKey source) {
this.project = source.project();
this.oldCommit = source.oldCommit();
this.newCommit = source.newCommit();
this.newFilePath = source.newFilePath();
this.renameScore = source.renameScore();
this.diffAlgorithm = source.diffAlgorithm();
this.whitespace = source.whitespace();
this.useTimeout = source.useTimeout();
}
@Override
public FileDiffCacheKey.Builder project(Project.NameKey project) {
if (project == null) {
throw new NullPointerException("Null project");
}
this.project = project;
return this;
}
@Override
public FileDiffCacheKey.Builder oldCommit(ObjectId oldCommit) {
if (oldCommit == null) {
throw new NullPointerException("Null oldCommit");
}
this.oldCommit = oldCommit;
return this;
}
@Override
public FileDiffCacheKey.Builder newCommit(ObjectId newCommit) {
if (newCommit == null) {
throw new NullPointerException("Null newCommit");
}
this.newCommit = newCommit;
return this;
}
@Override
public FileDiffCacheKey.Builder newFilePath(String newFilePath) {
if (newFilePath == null) {
throw new NullPointerException("Null newFilePath");
}
this.newFilePath = newFilePath;
return this;
}
@Override
public FileDiffCacheKey.Builder renameScore(int renameScore) {
this.renameScore = renameScore;
return this;
}
@Override
public FileDiffCacheKey.Builder diffAlgorithm(GitFileDiffCacheImpl.DiffAlgorithm diffAlgorithm) {
if (diffAlgorithm == null) {
throw new NullPointerException("Null diffAlgorithm");
}
this.diffAlgorithm = diffAlgorithm;
return this;
}
@Override
public FileDiffCacheKey.Builder whitespace(DiffPreferencesInfo.Whitespace whitespace) {
if (whitespace == null) {
throw new NullPointerException("Null whitespace");
}
this.whitespace = whitespace;
return this;
}
@Override
public FileDiffCacheKey.Builder useTimeout(boolean useTimeout) {
this.useTimeout = useTimeout;
return this;
}
@Override
public FileDiffCacheKey build() {
String missing = "";
if (this.project == null) {
missing += " project";
}
if (this.oldCommit == null) {
missing += " oldCommit";
}
if (this.newCommit == null) {
missing += " newCommit";
}
if (this.newFilePath == null) {
missing += " newFilePath";
}
if (this.renameScore == null) {
missing += " renameScore";
}
if (this.diffAlgorithm == null) {
missing += " diffAlgorithm";
}
if (this.whitespace == null) {
missing += " whitespace";
}
if (this.useTimeout == null) {
missing += " useTimeout";
}
if (!missing.isEmpty()) {
throw new IllegalStateException("Missing required properties:" + missing);
}
return new AutoValue_FileDiffCacheKey(
this.project,
this.oldCommit,
this.newCommit,
this.newFilePath,
this.renameScore,
this.diffAlgorithm,
this.whitespace,
this.useTimeout);
}
}
}