com.google.gerrit.server.query.approval.AutoValue_ApprovalContext Maven / Gradle / Ivy
package com.google.gerrit.server.query.approval;
import com.google.gerrit.entities.Account;
import com.google.gerrit.entities.LabelType;
import com.google.gerrit.entities.PatchSet;
import com.google.gerrit.extensions.client.ChangeKind;
import com.google.gerrit.server.notedb.ChangeNotes;
import com.google.gerrit.server.update.RepoView;
import javax.annotation.processing.Generated;
@Generated("com.google.auto.value.processor.AutoValueProcessor")
final class AutoValue_ApprovalContext extends ApprovalContext {
private final PatchSet.Id sourcePatchSetId;
private final Account.Id approverId;
private final LabelType labelType;
private final short approvalValue;
private final PatchSet targetPatchSet;
private final ChangeNotes changeNotes;
private final ChangeKind changeKind;
private final boolean isMerge;
private final RepoView repoView;
AutoValue_ApprovalContext(
PatchSet.Id sourcePatchSetId,
Account.Id approverId,
LabelType labelType,
short approvalValue,
PatchSet targetPatchSet,
ChangeNotes changeNotes,
ChangeKind changeKind,
boolean isMerge,
RepoView repoView) {
if (sourcePatchSetId == null) {
throw new NullPointerException("Null sourcePatchSetId");
}
this.sourcePatchSetId = sourcePatchSetId;
if (approverId == null) {
throw new NullPointerException("Null approverId");
}
this.approverId = approverId;
if (labelType == null) {
throw new NullPointerException("Null labelType");
}
this.labelType = labelType;
this.approvalValue = approvalValue;
if (targetPatchSet == null) {
throw new NullPointerException("Null targetPatchSet");
}
this.targetPatchSet = targetPatchSet;
if (changeNotes == null) {
throw new NullPointerException("Null changeNotes");
}
this.changeNotes = changeNotes;
if (changeKind == null) {
throw new NullPointerException("Null changeKind");
}
this.changeKind = changeKind;
this.isMerge = isMerge;
if (repoView == null) {
throw new NullPointerException("Null repoView");
}
this.repoView = repoView;
}
@Override
public PatchSet.Id sourcePatchSetId() {
return sourcePatchSetId;
}
@Override
public Account.Id approverId() {
return approverId;
}
@Override
public LabelType labelType() {
return labelType;
}
@Override
public short approvalValue() {
return approvalValue;
}
@Override
public PatchSet targetPatchSet() {
return targetPatchSet;
}
@Override
public ChangeNotes changeNotes() {
return changeNotes;
}
@Override
public ChangeKind changeKind() {
return changeKind;
}
@Override
public boolean isMerge() {
return isMerge;
}
@Override
public RepoView repoView() {
return repoView;
}
@Override
public String toString() {
return "ApprovalContext{"
+ "sourcePatchSetId=" + sourcePatchSetId + ", "
+ "approverId=" + approverId + ", "
+ "labelType=" + labelType + ", "
+ "approvalValue=" + approvalValue + ", "
+ "targetPatchSet=" + targetPatchSet + ", "
+ "changeNotes=" + changeNotes + ", "
+ "changeKind=" + changeKind + ", "
+ "isMerge=" + isMerge + ", "
+ "repoView=" + repoView
+ "}";
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof ApprovalContext) {
ApprovalContext that = (ApprovalContext) o;
return this.sourcePatchSetId.equals(that.sourcePatchSetId())
&& this.approverId.equals(that.approverId())
&& this.labelType.equals(that.labelType())
&& this.approvalValue == that.approvalValue()
&& this.targetPatchSet.equals(that.targetPatchSet())
&& this.changeNotes.equals(that.changeNotes())
&& this.changeKind.equals(that.changeKind())
&& this.isMerge == that.isMerge()
&& this.repoView.equals(that.repoView());
}
return false;
}
@Override
public int hashCode() {
int h$ = 1;
h$ *= 1000003;
h$ ^= sourcePatchSetId.hashCode();
h$ *= 1000003;
h$ ^= approverId.hashCode();
h$ *= 1000003;
h$ ^= labelType.hashCode();
h$ *= 1000003;
h$ ^= approvalValue;
h$ *= 1000003;
h$ ^= targetPatchSet.hashCode();
h$ *= 1000003;
h$ ^= changeNotes.hashCode();
h$ *= 1000003;
h$ ^= changeKind.hashCode();
h$ *= 1000003;
h$ ^= isMerge ? 1231 : 1237;
h$ *= 1000003;
h$ ^= repoView.hashCode();
return h$;
}
}