com.google.gerrit.server.patch.gitfilediff.AutoValue_GitFileDiff Maven / Gradle / Ivy
The newest version!
package com.google.gerrit.server.patch.gitfilediff;
import com.google.common.collect.ImmutableList;
import com.google.gerrit.entities.Patch;
import com.google.gerrit.server.patch.filediff.Edit;
import java.util.Optional;
import javax.annotation.processing.Generated;
import org.eclipse.jgit.lib.AbbreviatedObjectId;
@Generated("com.google.auto.value.processor.AutoValueProcessor")
final class AutoValue_GitFileDiff extends GitFileDiff {
private final ImmutableList edits;
private final String fileHeader;
private final Optional oldPath;
private final Optional newPath;
private final AbbreviatedObjectId oldId;
private final AbbreviatedObjectId newId;
private final Optional oldMode;
private final Optional newMode;
private final Patch.ChangeType changeType;
private final Optional patchType;
private final Optional negative;
private AutoValue_GitFileDiff(
ImmutableList edits,
String fileHeader,
Optional oldPath,
Optional newPath,
AbbreviatedObjectId oldId,
AbbreviatedObjectId newId,
Optional oldMode,
Optional newMode,
Patch.ChangeType changeType,
Optional patchType,
Optional negative) {
this.edits = edits;
this.fileHeader = fileHeader;
this.oldPath = oldPath;
this.newPath = newPath;
this.oldId = oldId;
this.newId = newId;
this.oldMode = oldMode;
this.newMode = newMode;
this.changeType = changeType;
this.patchType = patchType;
this.negative = negative;
}
@Override
public ImmutableList edits() {
return edits;
}
@Override
public String fileHeader() {
return fileHeader;
}
@Override
public Optional oldPath() {
return oldPath;
}
@Override
public Optional newPath() {
return newPath;
}
@Override
public AbbreviatedObjectId oldId() {
return oldId;
}
@Override
public AbbreviatedObjectId newId() {
return newId;
}
@Override
public Optional oldMode() {
return oldMode;
}
@Override
public Optional newMode() {
return newMode;
}
@Override
public Patch.ChangeType changeType() {
return changeType;
}
@Override
public Optional patchType() {
return patchType;
}
@Override
public Optional negative() {
return negative;
}
@Override
public String toString() {
return "GitFileDiff{"
+ "edits=" + edits + ", "
+ "fileHeader=" + fileHeader + ", "
+ "oldPath=" + oldPath + ", "
+ "newPath=" + newPath + ", "
+ "oldId=" + oldId + ", "
+ "newId=" + newId + ", "
+ "oldMode=" + oldMode + ", "
+ "newMode=" + newMode + ", "
+ "changeType=" + changeType + ", "
+ "patchType=" + patchType + ", "
+ "negative=" + negative
+ "}";
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof GitFileDiff) {
GitFileDiff that = (GitFileDiff) o;
return this.edits.equals(that.edits())
&& this.fileHeader.equals(that.fileHeader())
&& this.oldPath.equals(that.oldPath())
&& this.newPath.equals(that.newPath())
&& this.oldId.equals(that.oldId())
&& this.newId.equals(that.newId())
&& this.oldMode.equals(that.oldMode())
&& this.newMode.equals(that.newMode())
&& this.changeType.equals(that.changeType())
&& this.patchType.equals(that.patchType())
&& this.negative.equals(that.negative());
}
return false;
}
@Override
public int hashCode() {
int h$ = 1;
h$ *= 1000003;
h$ ^= edits.hashCode();
h$ *= 1000003;
h$ ^= fileHeader.hashCode();
h$ *= 1000003;
h$ ^= oldPath.hashCode();
h$ *= 1000003;
h$ ^= newPath.hashCode();
h$ *= 1000003;
h$ ^= oldId.hashCode();
h$ *= 1000003;
h$ ^= newId.hashCode();
h$ *= 1000003;
h$ ^= oldMode.hashCode();
h$ *= 1000003;
h$ ^= newMode.hashCode();
h$ *= 1000003;
h$ ^= changeType.hashCode();
h$ *= 1000003;
h$ ^= patchType.hashCode();
h$ *= 1000003;
h$ ^= negative.hashCode();
return h$;
}
@Override
public GitFileDiff.Builder toBuilder() {
return new Builder(this);
}
static final class Builder extends GitFileDiff.Builder {
private ImmutableList edits;
private String fileHeader;
private Optional oldPath = Optional.empty();
private Optional newPath = Optional.empty();
private AbbreviatedObjectId oldId;
private AbbreviatedObjectId newId;
private Optional oldMode = Optional.empty();
private Optional newMode = Optional.empty();
private Patch.ChangeType changeType;
private Optional patchType = Optional.empty();
private Optional negative = Optional.empty();
Builder() {
}
private Builder(GitFileDiff source) {
this.edits = source.edits();
this.fileHeader = source.fileHeader();
this.oldPath = source.oldPath();
this.newPath = source.newPath();
this.oldId = source.oldId();
this.newId = source.newId();
this.oldMode = source.oldMode();
this.newMode = source.newMode();
this.changeType = source.changeType();
this.patchType = source.patchType();
this.negative = source.negative();
}
@Override
public GitFileDiff.Builder edits(ImmutableList edits) {
if (edits == null) {
throw new NullPointerException("Null edits");
}
this.edits = edits;
return this;
}
@Override
public GitFileDiff.Builder fileHeader(String fileHeader) {
if (fileHeader == null) {
throw new NullPointerException("Null fileHeader");
}
this.fileHeader = fileHeader;
return this;
}
@Override
public GitFileDiff.Builder oldPath(Optional oldPath) {
if (oldPath == null) {
throw new NullPointerException("Null oldPath");
}
this.oldPath = oldPath;
return this;
}
@Override
public GitFileDiff.Builder newPath(Optional newPath) {
if (newPath == null) {
throw new NullPointerException("Null newPath");
}
this.newPath = newPath;
return this;
}
@Override
public GitFileDiff.Builder oldId(AbbreviatedObjectId oldId) {
if (oldId == null) {
throw new NullPointerException("Null oldId");
}
this.oldId = oldId;
return this;
}
@Override
public GitFileDiff.Builder newId(AbbreviatedObjectId newId) {
if (newId == null) {
throw new NullPointerException("Null newId");
}
this.newId = newId;
return this;
}
@Override
public GitFileDiff.Builder oldMode(Optional oldMode) {
if (oldMode == null) {
throw new NullPointerException("Null oldMode");
}
this.oldMode = oldMode;
return this;
}
@Override
public GitFileDiff.Builder newMode(Optional newMode) {
if (newMode == null) {
throw new NullPointerException("Null newMode");
}
this.newMode = newMode;
return this;
}
@Override
public GitFileDiff.Builder changeType(Patch.ChangeType changeType) {
if (changeType == null) {
throw new NullPointerException("Null changeType");
}
this.changeType = changeType;
return this;
}
@Override
public GitFileDiff.Builder patchType(Optional patchType) {
if (patchType == null) {
throw new NullPointerException("Null patchType");
}
this.patchType = patchType;
return this;
}
@Override
public GitFileDiff.Builder negative(Optional negative) {
if (negative == null) {
throw new NullPointerException("Null negative");
}
this.negative = negative;
return this;
}
@Override
public GitFileDiff build() {
if (this.edits == null
|| this.fileHeader == null
|| this.oldId == null
|| this.newId == null
|| this.changeType == null) {
StringBuilder missing = new StringBuilder();
if (this.edits == null) {
missing.append(" edits");
}
if (this.fileHeader == null) {
missing.append(" fileHeader");
}
if (this.oldId == null) {
missing.append(" oldId");
}
if (this.newId == null) {
missing.append(" newId");
}
if (this.changeType == null) {
missing.append(" changeType");
}
throw new IllegalStateException("Missing required properties:" + missing);
}
return new AutoValue_GitFileDiff(
this.edits,
this.fileHeader,
this.oldPath,
this.newPath,
this.oldId,
this.newId,
this.oldMode,
this.newMode,
this.changeType,
this.patchType,
this.negative);
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy