All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.graylog.plugins.views.search.validation.AutoValue_ValidationRequest Maven / Gradle / Ivy

There is a newer version: 6.0.1
Show newest version
package org.graylog.plugins.views.search.validation;

import com.google.common.collect.ImmutableSet;
import java.util.Optional;
import java.util.Set;
import javax.annotation.Generated;
import javax.annotation.Nullable;
import javax.validation.constraints.NotNull;
import org.graylog.plugins.views.search.Parameter;
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_ValidationRequest extends ValidationRequest {

  private final @NotNull BackendQuery query;

  private final @NotNull Optional filter;

  private final @NotNull TimeRange timerange;

  private final @NotNull Set streams;

  private final @NotNull ImmutableSet parameters;

  private AutoValue_ValidationRequest(
      @NotNull BackendQuery query,
      @NotNull Optional filter,
      @NotNull TimeRange timerange,
      @NotNull Set streams,
      @NotNull ImmutableSet parameters) {
    this.query = query;
    this.filter = filter;
    this.timerange = timerange;
    this.streams = streams;
    this.parameters = parameters;
  }

  @Override
  public @NotNull BackendQuery query() {
    return query;
  }

  @Override
  public @NotNull Optional filter() {
    return filter;
  }

  @Override
  public @NotNull TimeRange timerange() {
    return timerange;
  }

  @Override
  public @NotNull Set streams() {
    return streams;
  }

  @Override
  public @NotNull ImmutableSet parameters() {
    return parameters;
  }

  @Override
  public String toString() {
    return "ValidationRequest{"
        + "query=" + query + ", "
        + "filter=" + filter + ", "
        + "timerange=" + timerange + ", "
        + "streams=" + streams + ", "
        + "parameters=" + parameters
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof ValidationRequest) {
      ValidationRequest that = (ValidationRequest) o;
      return this.query.equals(that.query())
          && this.filter.equals(that.filter())
          && this.timerange.equals(that.timerange())
          && this.streams.equals(that.streams())
          && this.parameters.equals(that.parameters());
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h$ = 1;
    h$ *= 1000003;
    h$ ^= query.hashCode();
    h$ *= 1000003;
    h$ ^= filter.hashCode();
    h$ *= 1000003;
    h$ ^= timerange.hashCode();
    h$ *= 1000003;
    h$ ^= streams.hashCode();
    h$ *= 1000003;
    h$ ^= parameters.hashCode();
    return h$;
  }

  static final class Builder extends ValidationRequest.Builder {
    private @NotNull BackendQuery query;
    private @NotNull Optional filter = Optional.empty();
    private @NotNull TimeRange timerange;
    private @NotNull Set streams;
    private @NotNull ImmutableSet parameters;
    Builder() {
    }
    @Override
    public ValidationRequest.Builder query(@NotNull BackendQuery query) {
      if (query == null) {
        throw new NullPointerException("Null query");
      }
      this.query = query;
      return this;
    }
    @Override
    public ValidationRequest.Builder filter(@Nullable BackendQuery filter) {
      this.filter = Optional.ofNullable(filter);
      return this;
    }
    @Override
    public ValidationRequest.Builder timerange(@NotNull TimeRange timerange) {
      if (timerange == null) {
        throw new NullPointerException("Null timerange");
      }
      this.timerange = timerange;
      return this;
    }
    @Override
    public ValidationRequest.Builder streams(@NotNull Set streams) {
      if (streams == null) {
        throw new NullPointerException("Null streams");
      }
      this.streams = streams;
      return this;
    }
    @Override
    public ValidationRequest.Builder parameters(@NotNull ImmutableSet parameters) {
      if (parameters == null) {
        throw new NullPointerException("Null parameters");
      }
      this.parameters = parameters;
      return this;
    }
    @Override
    public ValidationRequest build() {
      String missing = "";
      if (this.query == null) {
        missing += " query";
      }
      if (this.timerange == null) {
        missing += " timerange";
      }
      if (this.streams == null) {
        missing += " streams";
      }
      if (this.parameters == null) {
        missing += " parameters";
      }
      if (!missing.isEmpty()) {
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_ValidationRequest(
          this.query,
          this.filter,
          this.timerange,
          this.streams,
          this.parameters);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy