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

org.graylog2.indexer.searches.$AutoValue_SearchesConfig Maven / Gradle / Ivy

There is a newer version: 6.1.4
Show newest version
package org.graylog2.indexer.searches;

import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import javax.annotation.Nullable;
import javax.annotation.processing.Generated;
import org.graylog2.plugin.indexer.searches.timeranges.TimeRange;

@Generated("com.google.auto.value.processor.AutoValueProcessor")
abstract class $AutoValue_SearchesConfig extends SearchesConfig {

  private final String query;

  @Nullable
  private final String filter;

  @Nullable
  private final List fields;

  private final TimeRange range;

  private final int limit;

  private final int offset;

  @Nullable
  private final Sorting sorting;

  $AutoValue_SearchesConfig(
      String query,
      @Nullable String filter,
      @Nullable List fields,
      TimeRange range,
      int limit,
      int offset,
      @Nullable Sorting sorting) {
    if (query == null) {
      throw new NullPointerException("Null query");
    }
    this.query = query;
    this.filter = filter;
    this.fields = fields;
    if (range == null) {
      throw new NullPointerException("Null range");
    }
    this.range = range;
    this.limit = limit;
    this.offset = offset;
    this.sorting = sorting;
  }

  @JsonProperty
  @Override
  public String query() {
    return query;
  }

  @JsonProperty
  @Nullable
  @Override
  public String filter() {
    return filter;
  }

  @JsonProperty
  @Nullable
  @Override
  public List fields() {
    return fields;
  }

  @JsonProperty
  @Override
  public TimeRange range() {
    return range;
  }

  @JsonProperty
  @Override
  public int limit() {
    return limit;
  }

  @JsonProperty
  @Override
  public int offset() {
    return offset;
  }

  @JsonProperty
  @Nullable
  @Override
  public Sorting sorting() {
    return sorting;
  }

  @Override
  public String toString() {
    return "SearchesConfig{"
        + "query=" + query + ", "
        + "filter=" + filter + ", "
        + "fields=" + fields + ", "
        + "range=" + range + ", "
        + "limit=" + limit + ", "
        + "offset=" + offset + ", "
        + "sorting=" + sorting
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof SearchesConfig) {
      SearchesConfig that = (SearchesConfig) o;
      return this.query.equals(that.query())
          && (this.filter == null ? that.filter() == null : this.filter.equals(that.filter()))
          && (this.fields == null ? that.fields() == null : this.fields.equals(that.fields()))
          && this.range.equals(that.range())
          && this.limit == that.limit()
          && this.offset == that.offset()
          && (this.sorting == null ? that.sorting() == null : this.sorting.equals(that.sorting()));
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h$ = 1;
    h$ *= 1000003;
    h$ ^= query.hashCode();
    h$ *= 1000003;
    h$ ^= (filter == null) ? 0 : filter.hashCode();
    h$ *= 1000003;
    h$ ^= (fields == null) ? 0 : fields.hashCode();
    h$ *= 1000003;
    h$ ^= range.hashCode();
    h$ *= 1000003;
    h$ ^= limit;
    h$ *= 1000003;
    h$ ^= offset;
    h$ *= 1000003;
    h$ ^= (sorting == null) ? 0 : sorting.hashCode();
    return h$;
  }

  static class Builder extends SearchesConfig.Builder {
    private String query;
    private String filter;
    private List fields;
    private TimeRange range;
    private int limit;
    private int offset;
    private Sorting sorting;
    private byte set$0;
    Builder() {
    }
    @Override
    public SearchesConfig.Builder query(String query) {
      if (query == null) {
        throw new NullPointerException("Null query");
      }
      this.query = query;
      return this;
    }
    @Override
    public SearchesConfig.Builder filter(String filter) {
      this.filter = filter;
      return this;
    }
    @Override
    public SearchesConfig.Builder fields(List fields) {
      this.fields = fields;
      return this;
    }
    @Override
    public SearchesConfig.Builder range(TimeRange range) {
      if (range == null) {
        throw new NullPointerException("Null range");
      }
      this.range = range;
      return this;
    }
    @Override
    public SearchesConfig.Builder limit(int limit) {
      this.limit = limit;
      set$0 |= (byte) 1;
      return this;
    }
    @Override
    public int limit() {
      if ((set$0 & 1) == 0) {
        throw new IllegalStateException("Property \"limit\" has not been set");
      }
      return limit;
    }
    @Override
    public SearchesConfig.Builder offset(int offset) {
      this.offset = offset;
      set$0 |= (byte) 2;
      return this;
    }
    @Override
    public SearchesConfig.Builder sorting(Sorting sorting) {
      this.sorting = sorting;
      return this;
    }
    @Override
    SearchesConfig autoBuild() {
      if (set$0 != 3
          || this.query == null
          || this.range == null) {
        StringBuilder missing = new StringBuilder();
        if (this.query == null) {
          missing.append(" query");
        }
        if (this.range == null) {
          missing.append(" range");
        }
        if ((set$0 & 1) == 0) {
          missing.append(" limit");
        }
        if ((set$0 & 2) == 0) {
          missing.append(" offset");
        }
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_SearchesConfig(
          this.query,
          this.filter,
          this.fields,
          this.range,
          this.limit,
          this.offset,
          this.sorting);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy