org.graylog.plugins.views.search.searchtypes.pivot.series.AutoValue_Average Maven / Gradle / Ivy
package org.graylog.plugins.views.search.searchtypes.pivot.series;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Optional;
import javax.annotation.Generated;
import javax.annotation.Nullable;
@Generated("com.google.auto.value.processor.AutoValueProcessor")
final class AutoValue_Average extends Average {
private final String type;
private final String id;
private final String field;
private AutoValue_Average(
String type,
String id,
String field) {
this.type = type;
this.id = id;
this.field = field;
}
@Override
public String type() {
return type;
}
@Override
public String id() {
return id;
}
@JsonProperty
@Override
public String field() {
return field;
}
@Override
public String toString() {
return "Average{"
+ "type=" + type + ", "
+ "id=" + id + ", "
+ "field=" + field
+ "}";
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof Average) {
Average that = (Average) o;
return (this.type.equals(that.type()))
&& (this.id.equals(that.id()))
&& (this.field.equals(that.field()));
}
return false;
}
@Override
public int hashCode() {
int h$ = 1;
h$ *= 1000003;
h$ ^= type.hashCode();
h$ *= 1000003;
h$ ^= id.hashCode();
h$ *= 1000003;
h$ ^= field.hashCode();
return h$;
}
static final class Builder extends Average.Builder {
private String type;
private String id;
private String field;
Builder() {
}
@Override
public Average.Builder type(String type) {
if (type == null) {
throw new NullPointerException("Null type");
}
this.type = type;
return this;
}
@Override
public Average.Builder id(@Nullable String id) {
if (id == null) {
throw new NullPointerException("Null id");
}
this.id = id;
return this;
}
@Override
Optional id() {
if (id == null) {
return Optional.empty();
} else {
return Optional.of(id);
}
}
@Override
public Average.Builder field(String field) {
if (field == null) {
throw new NullPointerException("Null field");
}
this.field = field;
return this;
}
@Override
String field() {
if (field == null) {
throw new IllegalStateException("Property \"field\" has not been set");
}
return field;
}
@Override
Average autoBuild() {
String missing = "";
if (this.type == null) {
missing += " type";
}
if (this.id == null) {
missing += " id";
}
if (this.field == null) {
missing += " field";
}
if (!missing.isEmpty()) {
throw new IllegalStateException("Missing required properties:" + missing);
}
return new AutoValue_Average(
this.type,
this.id,
this.field);
}
}
}