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

org.graylog.plugins.views.search.export.AutoValue_ResultFormat Maven / Gradle / Ivy

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

import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Generated;
import javax.annotation.Nullable;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Positive;
import org.graylog2.plugin.indexer.searches.timeranges.AbsoluteRange;

@Generated("com.google.auto.value.processor.AutoValueProcessor")
final class AutoValue_ResultFormat extends ResultFormat {

  private final @NotEmpty LinkedHashSet fieldsInOrder;

  private final Optional timerange;

  private final Optional limit;

  private final Map executionState;

  private final Optional filename;

  private AutoValue_ResultFormat(
      @NotEmpty LinkedHashSet fieldsInOrder,
      Optional timerange,
      Optional limit,
      Map executionState,
      Optional filename) {
    this.fieldsInOrder = fieldsInOrder;
    this.timerange = timerange;
    this.limit = limit;
    this.executionState = executionState;
    this.filename = filename;
  }

  @JsonProperty("fields_in_order")
  @Override
  public @NotEmpty LinkedHashSet fieldsInOrder() {
    return fieldsInOrder;
  }

  @JsonProperty
  @Override
  public Optional timerange() {
    return timerange;
  }

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

  @JsonProperty
  @Override
  public Map executionState() {
    return executionState;
  }

  @JsonProperty
  @Override
  public Optional filename() {
    return filename;
  }

  @Override
  public String toString() {
    return "ResultFormat{"
        + "fieldsInOrder=" + fieldsInOrder + ", "
        + "timerange=" + timerange + ", "
        + "limit=" + limit + ", "
        + "executionState=" + executionState + ", "
        + "filename=" + filename
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof ResultFormat) {
      ResultFormat that = (ResultFormat) o;
      return this.fieldsInOrder.equals(that.fieldsInOrder())
          && this.timerange.equals(that.timerange())
          && this.limit.equals(that.limit())
          && this.executionState.equals(that.executionState())
          && this.filename.equals(that.filename());
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h$ = 1;
    h$ *= 1000003;
    h$ ^= fieldsInOrder.hashCode();
    h$ *= 1000003;
    h$ ^= timerange.hashCode();
    h$ *= 1000003;
    h$ ^= limit.hashCode();
    h$ *= 1000003;
    h$ ^= executionState.hashCode();
    h$ *= 1000003;
    h$ ^= filename.hashCode();
    return h$;
  }

  static final class Builder extends ResultFormat.Builder {
    private @NotEmpty LinkedHashSet fieldsInOrder;
    private Optional timerange = Optional.empty();
    private Optional limit = Optional.empty();
    private Map executionState;
    private Optional filename = Optional.empty();
    Builder() {
    }
    @Override
    public ResultFormat.Builder fieldsInOrder(LinkedHashSet fieldsInOrder) {
      if (fieldsInOrder == null) {
        throw new NullPointerException("Null fieldsInOrder");
      }
      this.fieldsInOrder = fieldsInOrder;
      return this;
    }
    @Override
    public ResultFormat.Builder timerange(@Nullable AbsoluteRange timerange) {
      this.timerange = Optional.ofNullable(timerange);
      return this;
    }
    @Override
    public ResultFormat.Builder limit(@Nullable @Positive Integer limit) {
      this.limit = Optional.ofNullable(limit);
      return this;
    }
    @Override
    public ResultFormat.Builder executionState(Map executionState) {
      if (executionState == null) {
        throw new NullPointerException("Null executionState");
      }
      this.executionState = executionState;
      return this;
    }
    @Override
    public ResultFormat.Builder filename(@Nullable String filename) {
      this.filename = Optional.ofNullable(filename);
      return this;
    }
    @Override
    public ResultFormat build() {
      String missing = "";
      if (this.fieldsInOrder == null) {
        missing += " fieldsInOrder";
      }
      if (this.executionState == null) {
        missing += " executionState";
      }
      if (!missing.isEmpty()) {
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_ResultFormat(
          this.fieldsInOrder,
          this.timerange,
          this.limit,
          this.executionState,
          this.filename);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy