com.google.gerrit.server.rules.AutoValue_PrologOptions Maven / Gradle / Ivy
package com.google.gerrit.server.rules;
import com.google.gerrit.common.Nullable;
import java.util.Optional;
import javax.annotation.processing.Generated;
@Generated("com.google.auto.value.processor.AutoValueProcessor")
final class AutoValue_PrologOptions extends PrologOptions {
private final boolean logErrors;
private final boolean skipFilters;
private final Optional rule;
private AutoValue_PrologOptions(
boolean logErrors,
boolean skipFilters,
Optional rule) {
this.logErrors = logErrors;
this.skipFilters = skipFilters;
this.rule = rule;
}
@Override
boolean logErrors() {
return logErrors;
}
@Override
boolean skipFilters() {
return skipFilters;
}
@Override
Optional rule() {
return rule;
}
@Override
public String toString() {
return "PrologOptions{"
+ "logErrors=" + logErrors + ", "
+ "skipFilters=" + skipFilters + ", "
+ "rule=" + rule
+ "}";
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof PrologOptions) {
PrologOptions that = (PrologOptions) o;
return this.logErrors == that.logErrors()
&& this.skipFilters == that.skipFilters()
&& this.rule.equals(that.rule());
}
return false;
}
@Override
public int hashCode() {
int h$ = 1;
h$ *= 1000003;
h$ ^= logErrors ? 1231 : 1237;
h$ *= 1000003;
h$ ^= skipFilters ? 1231 : 1237;
h$ *= 1000003;
h$ ^= rule.hashCode();
return h$;
}
static final class Builder extends PrologOptions.Builder {
private Boolean logErrors;
private Boolean skipFilters;
private Optional rule = Optional.empty();
Builder() {
}
@Override
PrologOptions.Builder logErrors(boolean logErrors) {
this.logErrors = logErrors;
return this;
}
@Override
PrologOptions.Builder skipFilters(boolean skipFilters) {
this.skipFilters = skipFilters;
return this;
}
@Override
PrologOptions.Builder rule(@Nullable String rule) {
this.rule = Optional.ofNullable(rule);
return this;
}
@Override
PrologOptions build() {
String missing = "";
if (this.logErrors == null) {
missing += " logErrors";
}
if (this.skipFilters == null) {
missing += " skipFilters";
}
if (!missing.isEmpty()) {
throw new IllegalStateException("Missing required properties:" + missing);
}
return new AutoValue_PrologOptions(
this.logErrors,
this.skipFilters,
this.rule);
}
}
}