org.graylog.plugins.views.search.views.widgets.aggregation.AutoValue_AutoIntervalDTO Maven / Gradle / Ivy
package org.graylog.plugins.views.search.views.widgets.aggregation;
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_AutoIntervalDTO extends AutoIntervalDTO {
private final String type;
private final Optional scaling;
private AutoValue_AutoIntervalDTO(
String type,
Optional scaling) {
this.type = type;
this.scaling = scaling;
}
@JsonProperty
@Override
public String type() {
return type;
}
@Override
public Optional scaling() {
return scaling;
}
@Override
public String toString() {
return "AutoIntervalDTO{"
+ "type=" + type + ", "
+ "scaling=" + scaling
+ "}";
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof AutoIntervalDTO) {
AutoIntervalDTO that = (AutoIntervalDTO) o;
return this.type.equals(that.type())
&& this.scaling.equals(that.scaling());
}
return false;
}
@Override
public int hashCode() {
int h$ = 1;
h$ *= 1000003;
h$ ^= type.hashCode();
h$ *= 1000003;
h$ ^= scaling.hashCode();
return h$;
}
static final class Builder extends AutoIntervalDTO.Builder {
private String type;
private Optional scaling = Optional.empty();
Builder() {
}
@Override
public AutoIntervalDTO.Builder type(String type) {
if (type == null) {
throw new NullPointerException("Null type");
}
this.type = type;
return this;
}
@Override
public AutoIntervalDTO.Builder scaling(@Nullable Double scaling) {
this.scaling = Optional.ofNullable(scaling);
return this;
}
@Override
public AutoIntervalDTO build() {
String missing = "";
if (this.type == null) {
missing += " type";
}
if (!missing.isEmpty()) {
throw new IllegalStateException("Missing required properties:" + missing);
}
return new AutoValue_AutoIntervalDTO(
this.type,
this.scaling);
}
}
}