com.google.gerrit.entities.$AutoValue_SubmitRequirement Maven / Gradle / Ivy
package com.google.gerrit.entities;
import java.util.Optional;
import javax.annotation.processing.Generated;
@Generated("com.google.auto.value.processor.AutoValueProcessor")
abstract class $AutoValue_SubmitRequirement extends SubmitRequirement {
private final String name;
private final Optional description;
private final Optional applicabilityExpression;
private final SubmitRequirementExpression submittabilityExpression;
private final Optional overrideExpression;
private final boolean allowOverrideInChildProjects;
$AutoValue_SubmitRequirement(
String name,
Optional description,
Optional applicabilityExpression,
SubmitRequirementExpression submittabilityExpression,
Optional overrideExpression,
boolean allowOverrideInChildProjects) {
if (name == null) {
throw new NullPointerException("Null name");
}
this.name = name;
if (description == null) {
throw new NullPointerException("Null description");
}
this.description = description;
if (applicabilityExpression == null) {
throw new NullPointerException("Null applicabilityExpression");
}
this.applicabilityExpression = applicabilityExpression;
if (submittabilityExpression == null) {
throw new NullPointerException("Null submittabilityExpression");
}
this.submittabilityExpression = submittabilityExpression;
if (overrideExpression == null) {
throw new NullPointerException("Null overrideExpression");
}
this.overrideExpression = overrideExpression;
this.allowOverrideInChildProjects = allowOverrideInChildProjects;
}
@Override
public String name() {
return name;
}
@Override
public Optional description() {
return description;
}
@Override
public Optional applicabilityExpression() {
return applicabilityExpression;
}
@Override
public SubmitRequirementExpression submittabilityExpression() {
return submittabilityExpression;
}
@Override
public Optional overrideExpression() {
return overrideExpression;
}
@Override
public boolean allowOverrideInChildProjects() {
return allowOverrideInChildProjects;
}
@Override
public String toString() {
return "SubmitRequirement{"
+ "name=" + name + ", "
+ "description=" + description + ", "
+ "applicabilityExpression=" + applicabilityExpression + ", "
+ "submittabilityExpression=" + submittabilityExpression + ", "
+ "overrideExpression=" + overrideExpression + ", "
+ "allowOverrideInChildProjects=" + allowOverrideInChildProjects
+ "}";
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof SubmitRequirement) {
SubmitRequirement that = (SubmitRequirement) o;
return this.name.equals(that.name())
&& this.description.equals(that.description())
&& this.applicabilityExpression.equals(that.applicabilityExpression())
&& this.submittabilityExpression.equals(that.submittabilityExpression())
&& this.overrideExpression.equals(that.overrideExpression())
&& this.allowOverrideInChildProjects == that.allowOverrideInChildProjects();
}
return false;
}
@Override
public int hashCode() {
int h$ = 1;
h$ *= 1000003;
h$ ^= name.hashCode();
h$ *= 1000003;
h$ ^= description.hashCode();
h$ *= 1000003;
h$ ^= applicabilityExpression.hashCode();
h$ *= 1000003;
h$ ^= submittabilityExpression.hashCode();
h$ *= 1000003;
h$ ^= overrideExpression.hashCode();
h$ *= 1000003;
h$ ^= allowOverrideInChildProjects ? 1231 : 1237;
return h$;
}
static class Builder extends SubmitRequirement.Builder {
private String name;
private Optional description = Optional.empty();
private Optional applicabilityExpression = Optional.empty();
private SubmitRequirementExpression submittabilityExpression;
private Optional overrideExpression = Optional.empty();
private Boolean allowOverrideInChildProjects;
Builder() {
}
@Override
public SubmitRequirement.Builder setName(String name) {
if (name == null) {
throw new NullPointerException("Null name");
}
this.name = name;
return this;
}
@Override
public SubmitRequirement.Builder setDescription(Optional description) {
if (description == null) {
throw new NullPointerException("Null description");
}
this.description = description;
return this;
}
@Override
public SubmitRequirement.Builder setApplicabilityExpression(Optional applicabilityExpression) {
if (applicabilityExpression == null) {
throw new NullPointerException("Null applicabilityExpression");
}
this.applicabilityExpression = applicabilityExpression;
return this;
}
@Override
public SubmitRequirement.Builder setSubmittabilityExpression(SubmitRequirementExpression submittabilityExpression) {
if (submittabilityExpression == null) {
throw new NullPointerException("Null submittabilityExpression");
}
this.submittabilityExpression = submittabilityExpression;
return this;
}
@Override
public SubmitRequirement.Builder setOverrideExpression(Optional overrideExpression) {
if (overrideExpression == null) {
throw new NullPointerException("Null overrideExpression");
}
this.overrideExpression = overrideExpression;
return this;
}
@Override
public SubmitRequirement.Builder setAllowOverrideInChildProjects(boolean allowOverrideInChildProjects) {
this.allowOverrideInChildProjects = allowOverrideInChildProjects;
return this;
}
@Override
public SubmitRequirement build() {
String missing = "";
if (this.name == null) {
missing += " name";
}
if (this.submittabilityExpression == null) {
missing += " submittabilityExpression";
}
if (this.allowOverrideInChildProjects == null) {
missing += " allowOverrideInChildProjects";
}
if (!missing.isEmpty()) {
throw new IllegalStateException("Missing required properties:" + missing);
}
return new AutoValue_SubmitRequirement(
this.name,
this.description,
this.applicabilityExpression,
this.submittabilityExpression,
this.overrideExpression,
this.allowOverrideInChildProjects);
}
}
}