com.google.gerrit.entities.AutoValue_PatchSetApproval Maven / Gradle / Ivy
package com.google.gerrit.entities;
import java.sql.Timestamp;
import java.util.Optional;
import javax.annotation.processing.Generated;
@Generated("com.google.auto.value.processor.AutoValueProcessor")
final class AutoValue_PatchSetApproval extends PatchSetApproval {
private final PatchSetApproval.Key key;
private final short value;
private final Timestamp granted;
private final Optional tag;
private final Account.Id realAccountId;
private final boolean postSubmit;
private AutoValue_PatchSetApproval(
PatchSetApproval.Key key,
short value,
Timestamp granted,
Optional tag,
Account.Id realAccountId,
boolean postSubmit) {
this.key = key;
this.value = value;
this.granted = granted;
this.tag = tag;
this.realAccountId = realAccountId;
this.postSubmit = postSubmit;
}
@Override
public PatchSetApproval.Key key() {
return key;
}
@Override
public short value() {
return value;
}
@Override
public Timestamp granted() {
return granted;
}
@Override
public Optional tag() {
return tag;
}
@Override
public Account.Id realAccountId() {
return realAccountId;
}
@Override
public boolean postSubmit() {
return postSubmit;
}
@Override
public String toString() {
return "PatchSetApproval{"
+ "key=" + key + ", "
+ "value=" + value + ", "
+ "granted=" + granted + ", "
+ "tag=" + tag + ", "
+ "realAccountId=" + realAccountId + ", "
+ "postSubmit=" + postSubmit
+ "}";
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof PatchSetApproval) {
PatchSetApproval that = (PatchSetApproval) o;
return this.key.equals(that.key())
&& this.value == that.value()
&& this.granted.equals(that.granted())
&& this.tag.equals(that.tag())
&& this.realAccountId.equals(that.realAccountId())
&& this.postSubmit == that.postSubmit();
}
return false;
}
@Override
public int hashCode() {
int h$ = 1;
h$ *= 1000003;
h$ ^= key.hashCode();
h$ *= 1000003;
h$ ^= value;
h$ *= 1000003;
h$ ^= granted.hashCode();
h$ *= 1000003;
h$ ^= tag.hashCode();
h$ *= 1000003;
h$ ^= realAccountId.hashCode();
h$ *= 1000003;
h$ ^= postSubmit ? 1231 : 1237;
return h$;
}
@Override
public PatchSetApproval.Builder toBuilder() {
return new Builder(this);
}
static final class Builder extends PatchSetApproval.Builder {
private PatchSetApproval.Key key;
private Short value;
private Timestamp granted;
private Optional tag = Optional.empty();
private Account.Id realAccountId;
private Boolean postSubmit;
Builder() {
}
private Builder(PatchSetApproval source) {
this.key = source.key();
this.value = source.value();
this.granted = source.granted();
this.tag = source.tag();
this.realAccountId = source.realAccountId();
this.postSubmit = source.postSubmit();
}
@Override
public PatchSetApproval.Builder key(PatchSetApproval.Key key) {
if (key == null) {
throw new NullPointerException("Null key");
}
this.key = key;
return this;
}
@Override
public PatchSetApproval.Key key() {
if (key == null) {
throw new IllegalStateException("Property \"key\" has not been set");
}
return key;
}
@Override
public PatchSetApproval.Builder value(short value) {
this.value = value;
return this;
}
@Override
public PatchSetApproval.Builder granted(Timestamp granted) {
if (granted == null) {
throw new NullPointerException("Null granted");
}
this.granted = granted;
return this;
}
@Override
public PatchSetApproval.Builder tag(String tag) {
this.tag = Optional.of(tag);
return this;
}
@Override
public PatchSetApproval.Builder tag(Optional tag) {
if (tag == null) {
throw new NullPointerException("Null tag");
}
this.tag = tag;
return this;
}
@Override
public PatchSetApproval.Builder realAccountId(Account.Id realAccountId) {
if (realAccountId == null) {
throw new NullPointerException("Null realAccountId");
}
this.realAccountId = realAccountId;
return this;
}
@Override
Optional realAccountId() {
if (realAccountId == null) {
return Optional.empty();
} else {
return Optional.of(realAccountId);
}
}
@Override
public PatchSetApproval.Builder postSubmit(boolean postSubmit) {
this.postSubmit = postSubmit;
return this;
}
@Override
PatchSetApproval autoBuild() {
String missing = "";
if (this.key == null) {
missing += " key";
}
if (this.value == null) {
missing += " value";
}
if (this.granted == null) {
missing += " granted";
}
if (this.realAccountId == null) {
missing += " realAccountId";
}
if (this.postSubmit == null) {
missing += " postSubmit";
}
if (!missing.isEmpty()) {
throw new IllegalStateException("Missing required properties:" + missing);
}
return new AutoValue_PatchSetApproval(
this.key,
this.value,
this.granted,
this.tag,
this.realAccountId,
this.postSubmit);
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy