org.graylog.plugins.views.search.searchtypes.pivot.buckets.AutoValue_DateRange Maven / Gradle / Ivy
package org.graylog.plugins.views.search.searchtypes.pivot.buckets;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Optional;
import javax.annotation.processing.Generated;
import org.joda.time.DateTime;
@Generated("com.google.auto.value.processor.AutoValueProcessor")
final class AutoValue_DateRange extends DateRange {
private final Optional from;
private final Optional to;
private AutoValue_DateRange(
Optional from,
Optional to) {
this.from = from;
this.to = to;
}
@JsonProperty
@Override
public Optional from() {
return from;
}
@JsonProperty
@Override
public Optional to() {
return to;
}
@Override
public String toString() {
return "DateRange{"
+ "from=" + from + ", "
+ "to=" + to
+ "}";
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof DateRange) {
DateRange that = (DateRange) o;
return this.from.equals(that.from())
&& this.to.equals(that.to());
}
return false;
}
@Override
public int hashCode() {
int h$ = 1;
h$ *= 1000003;
h$ ^= from.hashCode();
h$ *= 1000003;
h$ ^= to.hashCode();
return h$;
}
static final class Builder extends DateRange.Builder {
private Optional from = Optional.empty();
private Optional to = Optional.empty();
Builder() {
}
@Override
public DateRange.Builder from(DateTime from) {
this.from = Optional.of(from);
return this;
}
@Override
public DateRange.Builder to(DateTime to) {
this.to = Optional.of(to);
return this;
}
@Override
public DateRange build() {
return new AutoValue_DateRange(
this.from,
this.to);
}
}
}