org.graylog.plugins.views.search.engine.suggestions.AutoValue_SuggestionRequest Maven / Gradle / Ivy
package org.graylog.plugins.views.search.engine.suggestions;
import java.util.Set;
import javax.annotation.Generated;
import org.graylog2.plugin.indexer.searches.timeranges.TimeRange;
@Generated("com.google.auto.value.processor.AutoValueProcessor")
final class AutoValue_SuggestionRequest extends SuggestionRequest {
private final String field;
private final String input;
private final TimeRange timerange;
private final Set streams;
private final int size;
private AutoValue_SuggestionRequest(
String field,
String input,
TimeRange timerange,
Set streams,
int size) {
this.field = field;
this.input = input;
this.timerange = timerange;
this.streams = streams;
this.size = size;
}
@Override
public String field() {
return field;
}
@Override
public String input() {
return input;
}
@Override
public TimeRange timerange() {
return timerange;
}
@Override
public Set streams() {
return streams;
}
@Override
public int size() {
return size;
}
@Override
public String toString() {
return "SuggestionRequest{"
+ "field=" + field + ", "
+ "input=" + input + ", "
+ "timerange=" + timerange + ", "
+ "streams=" + streams + ", "
+ "size=" + size
+ "}";
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof SuggestionRequest) {
SuggestionRequest that = (SuggestionRequest) o;
return this.field.equals(that.field())
&& this.input.equals(that.input())
&& this.timerange.equals(that.timerange())
&& this.streams.equals(that.streams())
&& this.size == that.size();
}
return false;
}
@Override
public int hashCode() {
int h$ = 1;
h$ *= 1000003;
h$ ^= field.hashCode();
h$ *= 1000003;
h$ ^= input.hashCode();
h$ *= 1000003;
h$ ^= timerange.hashCode();
h$ *= 1000003;
h$ ^= streams.hashCode();
h$ *= 1000003;
h$ ^= size;
return h$;
}
static final class Builder extends SuggestionRequest.Builder {
private String field;
private String input;
private TimeRange timerange;
private Set streams;
private Integer size;
Builder() {
}
@Override
public SuggestionRequest.Builder field(String field) {
if (field == null) {
throw new NullPointerException("Null field");
}
this.field = field;
return this;
}
@Override
public SuggestionRequest.Builder input(String input) {
if (input == null) {
throw new NullPointerException("Null input");
}
this.input = input;
return this;
}
@Override
public SuggestionRequest.Builder timerange(TimeRange timerange) {
if (timerange == null) {
throw new NullPointerException("Null timerange");
}
this.timerange = timerange;
return this;
}
@Override
public SuggestionRequest.Builder streams(Set streams) {
if (streams == null) {
throw new NullPointerException("Null streams");
}
this.streams = streams;
return this;
}
@Override
public SuggestionRequest.Builder size(int size) {
this.size = size;
return this;
}
@Override
public SuggestionRequest build() {
String missing = "";
if (this.field == null) {
missing += " field";
}
if (this.input == null) {
missing += " input";
}
if (this.timerange == null) {
missing += " timerange";
}
if (this.streams == null) {
missing += " streams";
}
if (this.size == null) {
missing += " size";
}
if (!missing.isEmpty()) {
throw new IllegalStateException("Missing required properties:" + missing);
}
return new AutoValue_SuggestionRequest(
this.field,
this.input,
this.timerange,
this.streams,
this.size);
}
}
}