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

org.graylog2.contentpacks.model.entities.$AutoValue_WidgetEntity Maven / Gradle / Ivy

There is a newer version: 6.1.4
Show newest version
package org.graylog2.contentpacks.model.entities;

import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import javax.annotation.Nullable;
import javax.annotation.processing.Generated;
import org.graylog.plugins.views.search.engine.BackendQuery;
import org.graylog.plugins.views.search.searchfilters.model.UsedSearchFilter;
import org.graylog.plugins.views.search.views.WidgetConfigDTO;
import org.graylog2.plugin.indexer.searches.timeranges.TimeRange;

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

  private final String id;

  private final String type;

  @Nullable
  private final String filter;

  private final List filters;

  private final Optional timerange;

  private final Optional query;

  private final Set streams;

  private final WidgetConfigDTO config;

  $AutoValue_WidgetEntity(
      String id,
      String type,
      @Nullable String filter,
      List filters,
      Optional timerange,
      Optional query,
      Set streams,
      WidgetConfigDTO config) {
    if (id == null) {
      throw new NullPointerException("Null id");
    }
    this.id = id;
    if (type == null) {
      throw new NullPointerException("Null type");
    }
    this.type = type;
    this.filter = filter;
    if (filters == null) {
      throw new NullPointerException("Null filters");
    }
    this.filters = filters;
    if (timerange == null) {
      throw new NullPointerException("Null timerange");
    }
    this.timerange = timerange;
    if (query == null) {
      throw new NullPointerException("Null query");
    }
    this.query = query;
    if (streams == null) {
      throw new NullPointerException("Null streams");
    }
    this.streams = streams;
    if (config == null) {
      throw new NullPointerException("Null config");
    }
    this.config = config;
  }

  @JsonProperty("id")
  @Override
  public String id() {
    return id;
  }

  @JsonProperty("type")
  @Override
  public String type() {
    return type;
  }

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

  @JsonProperty("filters")
  @Override
  public List filters() {
    return filters;
  }

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

  @JsonProperty("query")
  @Override
  public Optional query() {
    return query;
  }

  @JsonProperty("streams")
  @Override
  public Set streams() {
    return streams;
  }

  @JsonProperty("config")
  @Override
  public WidgetConfigDTO config() {
    return config;
  }

  @Override
  public String toString() {
    return "WidgetEntity{"
        + "id=" + id + ", "
        + "type=" + type + ", "
        + "filter=" + filter + ", "
        + "filters=" + filters + ", "
        + "timerange=" + timerange + ", "
        + "query=" + query + ", "
        + "streams=" + streams + ", "
        + "config=" + config
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof WidgetEntity) {
      WidgetEntity that = (WidgetEntity) o;
      return this.id.equals(that.id())
          && this.type.equals(that.type())
          && (this.filter == null ? that.filter() == null : this.filter.equals(that.filter()))
          && this.filters.equals(that.filters())
          && this.timerange.equals(that.timerange())
          && this.query.equals(that.query())
          && this.streams.equals(that.streams())
          && this.config.equals(that.config());
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h$ = 1;
    h$ *= 1000003;
    h$ ^= id.hashCode();
    h$ *= 1000003;
    h$ ^= type.hashCode();
    h$ *= 1000003;
    h$ ^= (filter == null) ? 0 : filter.hashCode();
    h$ *= 1000003;
    h$ ^= filters.hashCode();
    h$ *= 1000003;
    h$ ^= timerange.hashCode();
    h$ *= 1000003;
    h$ ^= query.hashCode();
    h$ *= 1000003;
    h$ ^= streams.hashCode();
    h$ *= 1000003;
    h$ ^= config.hashCode();
    return h$;
  }

  static class Builder extends WidgetEntity.Builder {
    private String id;
    private String type;
    private String filter;
    private List filters;
    private Optional timerange = Optional.empty();
    private Optional query = Optional.empty();
    private Set streams;
    private WidgetConfigDTO config;
    Builder() {
    }
    @Override
    public WidgetEntity.Builder id(String id) {
      if (id == null) {
        throw new NullPointerException("Null id");
      }
      this.id = id;
      return this;
    }
    @Override
    public WidgetEntity.Builder type(String type) {
      if (type == null) {
        throw new NullPointerException("Null type");
      }
      this.type = type;
      return this;
    }
    @Override
    public WidgetEntity.Builder filter(@Nullable String filter) {
      this.filter = filter;
      return this;
    }
    @Override
    public WidgetEntity.Builder filters(List filters) {
      if (filters == null) {
        throw new NullPointerException("Null filters");
      }
      this.filters = filters;
      return this;
    }
    @Override
    public WidgetEntity.Builder timerange(@Nullable TimeRange timerange) {
      this.timerange = Optional.ofNullable(timerange);
      return this;
    }
    @Override
    public WidgetEntity.Builder query(@Nullable BackendQuery query) {
      this.query = Optional.ofNullable(query);
      return this;
    }
    @Override
    public WidgetEntity.Builder streams(Set streams) {
      if (streams == null) {
        throw new NullPointerException("Null streams");
      }
      this.streams = streams;
      return this;
    }
    @Override
    public WidgetEntity.Builder config(WidgetConfigDTO config) {
      if (config == null) {
        throw new NullPointerException("Null config");
      }
      this.config = config;
      return this;
    }
    @Override
    public WidgetEntity build() {
      if (this.id == null
          || this.type == null
          || this.filters == null
          || this.streams == null
          || this.config == null) {
        StringBuilder missing = new StringBuilder();
        if (this.id == null) {
          missing.append(" id");
        }
        if (this.type == null) {
          missing.append(" type");
        }
        if (this.filters == null) {
          missing.append(" filters");
        }
        if (this.streams == null) {
          missing.append(" streams");
        }
        if (this.config == null) {
          missing.append(" config");
        }
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_WidgetEntity(
          this.id,
          this.type,
          this.filter,
          this.filters,
          this.timerange,
          this.query,
          this.streams,
          this.config);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy