org.graylog.events.contentpack.entities.AutoValue_AggregationEventProcessorConfigEntity Maven / Gradle / Ivy
package org.graylog.events.contentpack.entities;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.collect.ImmutableSet;
import java.util.List;
import java.util.Optional;
import javax.annotation.Generated;
import javax.annotation.Nullable;
import org.graylog.events.processor.aggregation.AggregationConditions;
import org.graylog.events.processor.aggregation.AggregationSeries;
import org.graylog2.contentpacks.model.entities.references.ValueReference;
@Generated("com.google.auto.value.processor.AutoValueProcessor")
final class AutoValue_AggregationEventProcessorConfigEntity extends AggregationEventProcessorConfigEntity {
private final String type;
private final ValueReference query;
private final ImmutableSet streams;
private final List groupBy;
private final List series;
private final Optional conditions;
private final long searchWithinMs;
private final long executeEveryMs;
private AutoValue_AggregationEventProcessorConfigEntity(
String type,
ValueReference query,
ImmutableSet streams,
List groupBy,
List series,
Optional conditions,
long searchWithinMs,
long executeEveryMs) {
this.type = type;
this.query = query;
this.streams = streams;
this.groupBy = groupBy;
this.series = series;
this.conditions = conditions;
this.searchWithinMs = searchWithinMs;
this.executeEveryMs = executeEveryMs;
}
@JsonProperty("type")
@Override
public String type() {
return type;
}
@JsonProperty("query")
@Override
public ValueReference query() {
return query;
}
@JsonProperty("streams")
@Override
public ImmutableSet streams() {
return streams;
}
@JsonProperty("group_by")
@Override
public List groupBy() {
return groupBy;
}
@JsonProperty("series")
@Override
public List series() {
return series;
}
@JsonProperty("conditions")
@Override
public Optional conditions() {
return conditions;
}
@JsonProperty("search_within_ms")
@Override
public long searchWithinMs() {
return searchWithinMs;
}
@JsonProperty("execute_every_ms")
@Override
public long executeEveryMs() {
return executeEveryMs;
}
@Override
public String toString() {
return "AggregationEventProcessorConfigEntity{"
+ "type=" + type + ", "
+ "query=" + query + ", "
+ "streams=" + streams + ", "
+ "groupBy=" + groupBy + ", "
+ "series=" + series + ", "
+ "conditions=" + conditions + ", "
+ "searchWithinMs=" + searchWithinMs + ", "
+ "executeEveryMs=" + executeEveryMs
+ "}";
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof AggregationEventProcessorConfigEntity) {
AggregationEventProcessorConfigEntity that = (AggregationEventProcessorConfigEntity) o;
return this.type.equals(that.type())
&& this.query.equals(that.query())
&& this.streams.equals(that.streams())
&& this.groupBy.equals(that.groupBy())
&& this.series.equals(that.series())
&& this.conditions.equals(that.conditions())
&& this.searchWithinMs == that.searchWithinMs()
&& this.executeEveryMs == that.executeEveryMs();
}
return false;
}
@Override
public int hashCode() {
int h$ = 1;
h$ *= 1000003;
h$ ^= type.hashCode();
h$ *= 1000003;
h$ ^= query.hashCode();
h$ *= 1000003;
h$ ^= streams.hashCode();
h$ *= 1000003;
h$ ^= groupBy.hashCode();
h$ *= 1000003;
h$ ^= series.hashCode();
h$ *= 1000003;
h$ ^= conditions.hashCode();
h$ *= 1000003;
h$ ^= (int) ((searchWithinMs >>> 32) ^ searchWithinMs);
h$ *= 1000003;
h$ ^= (int) ((executeEveryMs >>> 32) ^ executeEveryMs);
return h$;
}
@Override
public AggregationEventProcessorConfigEntity.Builder toBuilder() {
return new Builder(this);
}
static final class Builder extends AggregationEventProcessorConfigEntity.Builder {
private String type;
private ValueReference query;
private ImmutableSet streams;
private List groupBy;
private List series;
private Optional conditions = Optional.empty();
private Long searchWithinMs;
private Long executeEveryMs;
Builder() {
}
private Builder(AggregationEventProcessorConfigEntity source) {
this.type = source.type();
this.query = source.query();
this.streams = source.streams();
this.groupBy = source.groupBy();
this.series = source.series();
this.conditions = source.conditions();
this.searchWithinMs = source.searchWithinMs();
this.executeEveryMs = source.executeEveryMs();
}
@Override
public AggregationEventProcessorConfigEntity.Builder type(String type) {
if (type == null) {
throw new NullPointerException("Null type");
}
this.type = type;
return this;
}
@Override
public AggregationEventProcessorConfigEntity.Builder query(ValueReference query) {
if (query == null) {
throw new NullPointerException("Null query");
}
this.query = query;
return this;
}
@Override
public AggregationEventProcessorConfigEntity.Builder streams(ImmutableSet streams) {
if (streams == null) {
throw new NullPointerException("Null streams");
}
this.streams = streams;
return this;
}
@Override
public AggregationEventProcessorConfigEntity.Builder groupBy(List groupBy) {
if (groupBy == null) {
throw new NullPointerException("Null groupBy");
}
this.groupBy = groupBy;
return this;
}
@Override
public AggregationEventProcessorConfigEntity.Builder series(List series) {
if (series == null) {
throw new NullPointerException("Null series");
}
this.series = series;
return this;
}
@Override
public AggregationEventProcessorConfigEntity.Builder conditions(@Nullable AggregationConditions conditions) {
this.conditions = Optional.ofNullable(conditions);
return this;
}
@Override
public AggregationEventProcessorConfigEntity.Builder searchWithinMs(long searchWithinMs) {
this.searchWithinMs = searchWithinMs;
return this;
}
@Override
public AggregationEventProcessorConfigEntity.Builder executeEveryMs(long executeEveryMs) {
this.executeEveryMs = executeEveryMs;
return this;
}
@Override
public AggregationEventProcessorConfigEntity build() {
String missing = "";
if (this.type == null) {
missing += " type";
}
if (this.query == null) {
missing += " query";
}
if (this.streams == null) {
missing += " streams";
}
if (this.groupBy == null) {
missing += " groupBy";
}
if (this.series == null) {
missing += " series";
}
if (this.searchWithinMs == null) {
missing += " searchWithinMs";
}
if (this.executeEveryMs == null) {
missing += " executeEveryMs";
}
if (!missing.isEmpty()) {
throw new IllegalStateException("Missing required properties:" + missing);
}
return new AutoValue_AggregationEventProcessorConfigEntity(
this.type,
this.query,
this.streams,
this.groupBy,
this.series,
this.conditions,
this.searchWithinMs,
this.executeEveryMs);
}
}
}