org.graylog.plugins.map.search.AutoValue_MapDataSearchRequest Maven / Gradle / Ivy
package org.graylog.plugins.map.search;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Set;
import javax.annotation.Generated;
import javax.annotation.Nullable;
import org.graylog2.plugin.indexer.searches.timeranges.TimeRange;
@Generated("com.google.auto.value.processor.AutoValueProcessor")
final class AutoValue_MapDataSearchRequest extends MapDataSearchRequest {
private final String query;
private final TimeRange timerange;
private final int limit;
private final Set fields;
private final String streamId;
private AutoValue_MapDataSearchRequest(
String query,
TimeRange timerange,
int limit,
Set fields,
@Nullable String streamId) {
this.query = query;
this.timerange = timerange;
this.limit = limit;
this.fields = fields;
this.streamId = streamId;
}
@JsonProperty(value = "query")
@Override
public String query() {
return query;
}
@JsonProperty(value = "timerange")
@Override
public TimeRange timerange() {
return timerange;
}
@JsonProperty(value = "limit")
@Override
public int limit() {
return limit;
}
@JsonProperty(value = "fields")
@Override
public Set fields() {
return fields;
}
@JsonProperty(value = "stream_id")
@Nullable
@Override
public String streamId() {
return streamId;
}
@Override
public String toString() {
return "MapDataSearchRequest{"
+ "query=" + query + ", "
+ "timerange=" + timerange + ", "
+ "limit=" + limit + ", "
+ "fields=" + fields + ", "
+ "streamId=" + streamId
+ "}";
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof MapDataSearchRequest) {
MapDataSearchRequest that = (MapDataSearchRequest) o;
return (this.query.equals(that.query()))
&& (this.timerange.equals(that.timerange()))
&& (this.limit == that.limit())
&& (this.fields.equals(that.fields()))
&& ((this.streamId == null) ? (that.streamId() == null) : this.streamId.equals(that.streamId()));
}
return false;
}
@Override
public int hashCode() {
int h$ = 1;
h$ *= 1000003;
h$ ^= query.hashCode();
h$ *= 1000003;
h$ ^= timerange.hashCode();
h$ *= 1000003;
h$ ^= limit;
h$ *= 1000003;
h$ ^= fields.hashCode();
h$ *= 1000003;
h$ ^= (streamId == null) ? 0 : streamId.hashCode();
return h$;
}
@Override
public MapDataSearchRequest.Builder toBuilder() {
return new Builder(this);
}
static final class Builder extends MapDataSearchRequest.Builder {
private String query;
private TimeRange timerange;
private Integer limit;
private Set fields;
private String streamId;
Builder() {
}
private Builder(MapDataSearchRequest source) {
this.query = source.query();
this.timerange = source.timerange();
this.limit = source.limit();
this.fields = source.fields();
this.streamId = source.streamId();
}
@Override
public MapDataSearchRequest.Builder query(String query) {
if (query == null) {
throw new NullPointerException("Null query");
}
this.query = query;
return this;
}
@Override
public MapDataSearchRequest.Builder timerange(TimeRange timerange) {
if (timerange == null) {
throw new NullPointerException("Null timerange");
}
this.timerange = timerange;
return this;
}
@Override
public MapDataSearchRequest.Builder limit(int limit) {
this.limit = limit;
return this;
}
@Override
public MapDataSearchRequest.Builder fields(Set fields) {
if (fields == null) {
throw new NullPointerException("Null fields");
}
this.fields = fields;
return this;
}
@Override
public MapDataSearchRequest.Builder streamId(String streamId) {
this.streamId = streamId;
return this;
}
@Override
public MapDataSearchRequest build() {
String missing = "";
if (this.query == null) {
missing += " query";
}
if (this.timerange == null) {
missing += " timerange";
}
if (this.limit == null) {
missing += " limit";
}
if (this.fields == null) {
missing += " fields";
}
if (!missing.isEmpty()) {
throw new IllegalStateException("Missing required properties:" + missing);
}
return new AutoValue_MapDataSearchRequest(
this.query,
this.timerange,
this.limit,
this.fields,
this.streamId);
}
}
}