org.graylog2.plugin.indexer.searches.timeranges.AutoValue_RelativeRange Maven / Gradle / Ivy
package org.graylog2.plugin.indexer.searches.timeranges;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.OptionalInt;
import javax.annotation.Generated;
@Generated("com.google.auto.value.processor.AutoValueProcessor")
final class AutoValue_RelativeRange extends RelativeRange {
private final String type;
private final OptionalInt range;
private final OptionalInt from;
private final OptionalInt to;
private AutoValue_RelativeRange(
String type,
OptionalInt range,
OptionalInt from,
OptionalInt to) {
this.type = type;
this.range = range;
this.from = from;
this.to = to;
}
@JsonProperty
@Override
public String type() {
return type;
}
@JsonProperty
@Override
public OptionalInt range() {
return range;
}
@JsonProperty
@Override
public OptionalInt from() {
return from;
}
@JsonProperty
@Override
public OptionalInt to() {
return to;
}
@Override
public String toString() {
return "RelativeRange{"
+ "type=" + type + ", "
+ "range=" + range + ", "
+ "from=" + from + ", "
+ "to=" + to
+ "}";
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof RelativeRange) {
RelativeRange that = (RelativeRange) o;
return this.type.equals(that.type())
&& this.range.equals(that.range())
&& this.from.equals(that.from())
&& this.to.equals(that.to());
}
return false;
}
@Override
public int hashCode() {
int h$ = 1;
h$ *= 1000003;
h$ ^= type.hashCode();
h$ *= 1000003;
h$ ^= range.hashCode();
h$ *= 1000003;
h$ ^= from.hashCode();
h$ *= 1000003;
h$ ^= to.hashCode();
return h$;
}
static final class Builder extends RelativeRange.Builder {
private String type;
private OptionalInt range = OptionalInt.empty();
private OptionalInt from = OptionalInt.empty();
private OptionalInt to = OptionalInt.empty();
Builder() {
}
@Override
public RelativeRange.Builder type(String type) {
if (type == null) {
throw new NullPointerException("Null type");
}
this.type = type;
return this;
}
@Override
public RelativeRange.Builder range(int range) {
this.range = OptionalInt.of(range);
return this;
}
@Override
OptionalInt range() {
return range;
}
@Override
public RelativeRange.Builder from(int from) {
this.from = OptionalInt.of(from);
return this;
}
@Override
OptionalInt from() {
return from;
}
@Override
public RelativeRange.Builder to(int to) {
this.to = OptionalInt.of(to);
return this;
}
@Override
OptionalInt to() {
return to;
}
@Override
RelativeRange autoBuild() {
String missing = "";
if (this.type == null) {
missing += " type";
}
if (!missing.isEmpty()) {
throw new IllegalStateException("Missing required properties:" + missing);
}
return new AutoValue_RelativeRange(
this.type,
this.range,
this.from,
this.to);
}
}
}