org.graylog.plugins.views.search.rest.AutoValue_ExecutionStateGlobalOverride Maven / Gradle / Ivy
package org.graylog.plugins.views.search.rest;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import java.util.Optional;
import javax.annotation.Generated;
import javax.annotation.Nullable;
import org.graylog.plugins.views.search.engine.BackendQuery;
import org.graylog2.plugin.indexer.searches.timeranges.TimeRange;
@Generated("com.google.auto.value.processor.AutoValueProcessor")
final class AutoValue_ExecutionStateGlobalOverride extends ExecutionStateGlobalOverride {
private final Optional timerange;
private final Optional query;
private final Optional limit;
private final Optional offset;
private final ImmutableMap searchTypes;
private final ImmutableSet keepSearchTypes;
private AutoValue_ExecutionStateGlobalOverride(
Optional timerange,
Optional query,
Optional limit,
Optional offset,
ImmutableMap searchTypes,
ImmutableSet keepSearchTypes) {
this.timerange = timerange;
this.query = query;
this.limit = limit;
this.offset = offset;
this.searchTypes = searchTypes;
this.keepSearchTypes = keepSearchTypes;
}
@JsonProperty
@Override
public Optional timerange() {
return timerange;
}
@JsonProperty
@Override
public Optional query() {
return query;
}
@JsonProperty
@Override
public Optional limit() {
return limit;
}
@JsonProperty
@Override
public Optional offset() {
return offset;
}
@JsonProperty
@Override
public ImmutableMap searchTypes() {
return searchTypes;
}
@JsonProperty
@Override
public ImmutableSet keepSearchTypes() {
return keepSearchTypes;
}
@Override
public String toString() {
return "ExecutionStateGlobalOverride{"
+ "timerange=" + timerange + ", "
+ "query=" + query + ", "
+ "limit=" + limit + ", "
+ "offset=" + offset + ", "
+ "searchTypes=" + searchTypes + ", "
+ "keepSearchTypes=" + keepSearchTypes
+ "}";
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof ExecutionStateGlobalOverride) {
ExecutionStateGlobalOverride that = (ExecutionStateGlobalOverride) o;
return this.timerange.equals(that.timerange())
&& this.query.equals(that.query())
&& this.limit.equals(that.limit())
&& this.offset.equals(that.offset())
&& this.searchTypes.equals(that.searchTypes())
&& this.keepSearchTypes.equals(that.keepSearchTypes());
}
return false;
}
@Override
public int hashCode() {
int h$ = 1;
h$ *= 1000003;
h$ ^= timerange.hashCode();
h$ *= 1000003;
h$ ^= query.hashCode();
h$ *= 1000003;
h$ ^= limit.hashCode();
h$ *= 1000003;
h$ ^= offset.hashCode();
h$ *= 1000003;
h$ ^= searchTypes.hashCode();
h$ *= 1000003;
h$ ^= keepSearchTypes.hashCode();
return h$;
}
@Override
public ExecutionStateGlobalOverride.Builder toBuilder() {
return new Builder(this);
}
static final class Builder extends ExecutionStateGlobalOverride.Builder {
private Optional timerange = Optional.empty();
private Optional query = Optional.empty();
private Optional limit = Optional.empty();
private Optional offset = Optional.empty();
private ImmutableMap.Builder searchTypesBuilder$;
private ImmutableMap searchTypes;
private ImmutableSet.Builder keepSearchTypesBuilder$;
private ImmutableSet keepSearchTypes;
Builder() {
}
private Builder(ExecutionStateGlobalOverride source) {
this.timerange = source.timerange();
this.query = source.query();
this.limit = source.limit();
this.offset = source.offset();
this.searchTypes = source.searchTypes();
this.keepSearchTypes = source.keepSearchTypes();
}
@Override
public ExecutionStateGlobalOverride.Builder timerange(@Nullable TimeRange timerange) {
this.timerange = Optional.ofNullable(timerange);
return this;
}
@Override
public ExecutionStateGlobalOverride.Builder query(@Nullable BackendQuery query) {
this.query = Optional.ofNullable(query);
return this;
}
@Override
public ExecutionStateGlobalOverride.Builder limit(@Nullable Integer limit) {
this.limit = Optional.ofNullable(limit);
return this;
}
@Override
public ExecutionStateGlobalOverride.Builder offset(@Nullable Integer offset) {
this.offset = Optional.ofNullable(offset);
return this;
}
@Override
public ExecutionStateGlobalOverride.Builder searchTypes(ImmutableMap searchTypes) {
if (searchTypes == null) {
throw new NullPointerException("Null searchTypes");
}
if (searchTypesBuilder$ != null) {
throw new IllegalStateException("Cannot set searchTypes after calling searchTypesBuilder()");
}
this.searchTypes = searchTypes;
return this;
}
@Override
public ImmutableMap.Builder searchTypesBuilder() {
if (searchTypesBuilder$ == null) {
if (searchTypes == null) {
searchTypesBuilder$ = ImmutableMap.builder();
} else {
searchTypesBuilder$ = ImmutableMap.builder();
searchTypesBuilder$.putAll(searchTypes);
searchTypes = null;
}
}
return searchTypesBuilder$;
}
@Override
public ExecutionStateGlobalOverride.Builder keepSearchTypes(ImmutableSet keepSearchTypes) {
if (keepSearchTypes == null) {
throw new NullPointerException("Null keepSearchTypes");
}
if (keepSearchTypesBuilder$ != null) {
throw new IllegalStateException("Cannot set keepSearchTypes after calling keepSearchTypesBuilder()");
}
this.keepSearchTypes = keepSearchTypes;
return this;
}
@Override
public ImmutableSet.Builder keepSearchTypesBuilder() {
if (keepSearchTypesBuilder$ == null) {
if (keepSearchTypes == null) {
keepSearchTypesBuilder$ = ImmutableSet.builder();
} else {
keepSearchTypesBuilder$ = ImmutableSet.builder();
keepSearchTypesBuilder$.addAll(keepSearchTypes);
keepSearchTypes = null;
}
}
return keepSearchTypesBuilder$;
}
@Override
public ExecutionStateGlobalOverride build() {
if (searchTypesBuilder$ != null) {
this.searchTypes = searchTypesBuilder$.build();
} else if (this.searchTypes == null) {
this.searchTypes = ImmutableMap.of();
}
if (keepSearchTypesBuilder$ != null) {
this.keepSearchTypes = keepSearchTypesBuilder$.build();
} else if (this.keepSearchTypes == null) {
this.keepSearchTypes = ImmutableSet.of();
}
return new AutoValue_ExecutionStateGlobalOverride(
this.timerange,
this.query,
this.limit,
this.offset,
this.searchTypes,
this.keepSearchTypes);
}
}
}