org.graylog2.indexer.fieldtypes.AutoValue_FieldTypeDTO Maven / Gradle / Ivy
package org.graylog2.indexer.fieldtypes;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Set;
import javax.annotation.Generated;
@Generated("com.google.auto.value.processor.AutoValueProcessor")
final class AutoValue_FieldTypeDTO extends FieldTypeDTO {
private final String fieldName;
private final String physicalType;
private final Set properties;
private AutoValue_FieldTypeDTO(
String fieldName,
String physicalType,
Set properties) {
this.fieldName = fieldName;
this.physicalType = physicalType;
this.properties = properties;
}
@JsonProperty("field_name")
@Override
public String fieldName() {
return fieldName;
}
@JsonProperty("physical_type")
@Override
public String physicalType() {
return physicalType;
}
@JsonProperty("properties")
@Override
public Set properties() {
return properties;
}
@Override
public String toString() {
return "FieldTypeDTO{"
+ "fieldName=" + fieldName + ", "
+ "physicalType=" + physicalType + ", "
+ "properties=" + properties
+ "}";
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof FieldTypeDTO) {
FieldTypeDTO that = (FieldTypeDTO) o;
return this.fieldName.equals(that.fieldName())
&& this.physicalType.equals(that.physicalType())
&& this.properties.equals(that.properties());
}
return false;
}
@Override
public int hashCode() {
int h$ = 1;
h$ *= 1000003;
h$ ^= fieldName.hashCode();
h$ *= 1000003;
h$ ^= physicalType.hashCode();
h$ *= 1000003;
h$ ^= properties.hashCode();
return h$;
}
@Override
public FieldTypeDTO.Builder toBuilder() {
return new Builder(this);
}
static final class Builder extends FieldTypeDTO.Builder {
private String fieldName;
private String physicalType;
private Set properties;
Builder() {
}
private Builder(FieldTypeDTO source) {
this.fieldName = source.fieldName();
this.physicalType = source.physicalType();
this.properties = source.properties();
}
@Override
public FieldTypeDTO.Builder fieldName(String fieldName) {
if (fieldName == null) {
throw new NullPointerException("Null fieldName");
}
this.fieldName = fieldName;
return this;
}
@Override
public FieldTypeDTO.Builder physicalType(String physicalType) {
if (physicalType == null) {
throw new NullPointerException("Null physicalType");
}
this.physicalType = physicalType;
return this;
}
@Override
public FieldTypeDTO.Builder properties(Set properties) {
if (properties == null) {
throw new NullPointerException("Null properties");
}
this.properties = properties;
return this;
}
@Override
public FieldTypeDTO build() {
String missing = "";
if (this.fieldName == null) {
missing += " fieldName";
}
if (this.physicalType == null) {
missing += " physicalType";
}
if (this.properties == null) {
missing += " properties";
}
if (!missing.isEmpty()) {
throw new IllegalStateException("Missing required properties:" + missing);
}
return new AutoValue_FieldTypeDTO(
this.fieldName,
this.physicalType,
this.properties);
}
}
}