org.graylog.plugins.views.migrations.V20191125144500_MigrateDashboardsToViewsSupport.viewwidgets.AutoValue_TimeUnitInterval Maven / Gradle / Ivy
package org.graylog.plugins.views.migrations.V20191125144500_MigrateDashboardsToViewsSupport.viewwidgets;
import com.fasterxml.jackson.annotation.JsonProperty;
import javax.annotation.processing.Generated;
@Generated("com.google.auto.value.processor.AutoValueProcessor")
final class AutoValue_TimeUnitInterval extends TimeUnitInterval {
private final String type;
private final int value;
private final TimeUnitInterval.IntervalUnit unit;
private AutoValue_TimeUnitInterval(
String type,
int value,
TimeUnitInterval.IntervalUnit unit) {
this.type = type;
this.value = value;
this.unit = unit;
}
@JsonProperty
@Override
public String type() {
return type;
}
@JsonProperty("value")
@Override
public int value() {
return value;
}
@JsonProperty("unit")
@Override
public TimeUnitInterval.IntervalUnit unit() {
return unit;
}
@Override
public String toString() {
return "TimeUnitInterval{"
+ "type=" + type + ", "
+ "value=" + value + ", "
+ "unit=" + unit
+ "}";
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof TimeUnitInterval) {
TimeUnitInterval that = (TimeUnitInterval) o;
return this.type.equals(that.type())
&& this.value == that.value()
&& this.unit.equals(that.unit());
}
return false;
}
@Override
public int hashCode() {
int h$ = 1;
h$ *= 1000003;
h$ ^= type.hashCode();
h$ *= 1000003;
h$ ^= value;
h$ *= 1000003;
h$ ^= unit.hashCode();
return h$;
}
static final class Builder extends TimeUnitInterval.Builder {
private String type;
private Integer value;
private TimeUnitInterval.IntervalUnit unit;
Builder() {
}
@Override
public TimeUnitInterval.Builder type(String type) {
if (type == null) {
throw new NullPointerException("Null type");
}
this.type = type;
return this;
}
@Override
public TimeUnitInterval.Builder value(int value) {
this.value = value;
return this;
}
@Override
public TimeUnitInterval.Builder unit(TimeUnitInterval.IntervalUnit unit) {
if (unit == null) {
throw new NullPointerException("Null unit");
}
this.unit = unit;
return this;
}
@Override
public TimeUnitInterval build() {
String missing = "";
if (this.type == null) {
missing += " type";
}
if (this.value == null) {
missing += " value";
}
if (this.unit == null) {
missing += " unit";
}
if (!missing.isEmpty()) {
throw new IllegalStateException("Missing required properties:" + missing);
}
return new AutoValue_TimeUnitInterval(
this.type,
this.value,
this.unit);
}
}
}