com.google.gerrit.index.AutoValue_IndexedField Maven / Gradle / Ivy
package com.google.gerrit.index;
import com.google.common.reflect.TypeToken;
import com.google.gerrit.entities.converter.ProtoConverter;
import com.google.protobuf.MessageLite;
import java.util.Optional;
import javax.annotation.processing.Generated;
@Generated("com.google.auto.value.processor.AutoValueProcessor")
final class AutoValue_IndexedField extends IndexedField {
private final String name;
private final Optional description;
private final boolean required;
private final boolean stored;
private final boolean repeatable;
private final Optional size;
private final SchemaFieldDefs.Getter getter;
private final Optional> fieldSetter;
private final TypeToken fieldType;
private final Optional> protoConverter;
private AutoValue_IndexedField(
String name,
Optional description,
boolean required,
boolean stored,
boolean repeatable,
Optional size,
SchemaFieldDefs.Getter getter,
Optional> fieldSetter,
TypeToken fieldType,
Optional> protoConverter) {
this.name = name;
this.description = description;
this.required = required;
this.stored = stored;
this.repeatable = repeatable;
this.size = size;
this.getter = getter;
this.fieldSetter = fieldSetter;
this.fieldType = fieldType;
this.protoConverter = protoConverter;
}
@Override
public String name() {
return name;
}
@Override
public Optional description() {
return description;
}
@Override
public boolean required() {
return required;
}
@Override
public boolean stored() {
return stored;
}
@Override
public boolean repeatable() {
return repeatable;
}
@Override
public Optional size() {
return size;
}
@Override
public SchemaFieldDefs.Getter getter() {
return getter;
}
@Override
public Optional> fieldSetter() {
return fieldSetter;
}
@Override
public TypeToken fieldType() {
return fieldType;
}
@Override
public Optional> protoConverter() {
return protoConverter;
}
@Override
public String toString() {
return "IndexedField{"
+ "name=" + name + ", "
+ "description=" + description + ", "
+ "required=" + required + ", "
+ "stored=" + stored + ", "
+ "repeatable=" + repeatable + ", "
+ "size=" + size + ", "
+ "getter=" + getter + ", "
+ "fieldSetter=" + fieldSetter + ", "
+ "fieldType=" + fieldType + ", "
+ "protoConverter=" + protoConverter
+ "}";
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof IndexedField) {
IndexedField, ?> that = (IndexedField, ?>) o;
return this.name.equals(that.name())
&& this.description.equals(that.description())
&& this.required == that.required()
&& this.stored == that.stored()
&& this.repeatable == that.repeatable()
&& this.size.equals(that.size())
&& this.getter.equals(that.getter())
&& this.fieldSetter.equals(that.fieldSetter())
&& this.fieldType.equals(that.fieldType())
&& this.protoConverter.equals(that.protoConverter());
}
return false;
}
@Override
public int hashCode() {
int h$ = 1;
h$ *= 1000003;
h$ ^= name.hashCode();
h$ *= 1000003;
h$ ^= description.hashCode();
h$ *= 1000003;
h$ ^= required ? 1231 : 1237;
h$ *= 1000003;
h$ ^= stored ? 1231 : 1237;
h$ *= 1000003;
h$ ^= repeatable ? 1231 : 1237;
h$ *= 1000003;
h$ ^= size.hashCode();
h$ *= 1000003;
h$ ^= getter.hashCode();
h$ *= 1000003;
h$ ^= fieldSetter.hashCode();
h$ *= 1000003;
h$ ^= fieldType.hashCode();
h$ *= 1000003;
h$ ^= protoConverter.hashCode();
return h$;
}
static final class Builder extends IndexedField.Builder {
private String name;
private Optional description = Optional.empty();
private boolean required;
private boolean stored;
private boolean repeatable;
private Optional size = Optional.empty();
private SchemaFieldDefs.Getter getter;
private Optional> fieldSetter = Optional.empty();
private TypeToken fieldType;
private Optional> protoConverter = Optional.empty();
private byte set$0;
Builder() {
}
@Override
public IndexedField.Builder name(String name) {
if (name == null) {
throw new NullPointerException("Null name");
}
this.name = name;
return this;
}
@Override
public IndexedField.Builder description(Optional description) {
if (description == null) {
throw new NullPointerException("Null description");
}
this.description = description;
return this;
}
@Override
public IndexedField.Builder description(String description) {
this.description = Optional.of(description);
return this;
}
@Override
public IndexedField.Builder required(boolean required) {
this.required = required;
set$0 |= (byte) 1;
return this;
}
@Override
public IndexedField.Builder stored(boolean stored) {
this.stored = stored;
set$0 |= (byte) 2;
return this;
}
@Override
IndexedField.Builder repeatable(boolean repeatable) {
this.repeatable = repeatable;
set$0 |= (byte) 4;
return this;
}
@Override
public IndexedField.Builder size(Optional size) {
if (size == null) {
throw new NullPointerException("Null size");
}
this.size = size;
return this;
}
@Override
public IndexedField.Builder size(Integer size) {
this.size = Optional.of(size);
return this;
}
@Override
public IndexedField.Builder getter(SchemaFieldDefs.Getter getter) {
if (getter == null) {
throw new NullPointerException("Null getter");
}
this.getter = getter;
return this;
}
@Override
public IndexedField.Builder fieldSetter(Optional> fieldSetter) {
if (fieldSetter == null) {
throw new NullPointerException("Null fieldSetter");
}
this.fieldSetter = fieldSetter;
return this;
}
@Override
public IndexedField.Builder fieldType(TypeToken fieldType) {
if (fieldType == null) {
throw new NullPointerException("Null fieldType");
}
this.fieldType = fieldType;
return this;
}
@Override
TypeToken fieldType() {
if (this.fieldType == null) {
throw new IllegalStateException("Property \"fieldType\" has not been set");
}
return fieldType;
}
@Override
public IndexedField.Builder protoConverter(Optional> protoConverter) {
if (protoConverter == null) {
throw new NullPointerException("Null protoConverter");
}
this.protoConverter = protoConverter;
return this;
}
@Override
IndexedField autoBuild() {
if (set$0 != 7
|| this.name == null
|| this.getter == null
|| this.fieldType == null) {
StringBuilder missing = new StringBuilder();
if (this.name == null) {
missing.append(" name");
}
if ((set$0 & 1) == 0) {
missing.append(" required");
}
if ((set$0 & 2) == 0) {
missing.append(" stored");
}
if ((set$0 & 4) == 0) {
missing.append(" repeatable");
}
if (this.getter == null) {
missing.append(" getter");
}
if (this.fieldType == null) {
missing.append(" fieldType");
}
throw new IllegalStateException("Missing required properties:" + missing);
}
return new AutoValue_IndexedField(
this.name,
this.description,
this.required,
this.stored,
this.repeatable,
this.size,
this.getter,
this.fieldSetter,
this.fieldType,
this.protoConverter);
}
}
}