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

org.graylog.plugins.views.search.searchtypes.pivot.series.AutoValue_Percentile Maven / Gradle / Ivy

There is a newer version: 5.2.7
Show newest version


package org.graylog.plugins.views.search.searchtypes.pivot.series;

import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Optional;
import javax.annotation.Generated;
import javax.annotation.Nullable;

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

  private final String type;

  private final String id;

  private final String field;

  private final Double percentile;

  private AutoValue_Percentile(
      String type,
      String id,
      String field,
      Double percentile) {
    this.type = type;
    this.id = id;
    this.field = field;
    this.percentile = percentile;
  }

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

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

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

  @JsonProperty
  @Override
  public Double percentile() {
    return percentile;
  }

  @Override
  public String toString() {
    return "Percentile{"
         + "type=" + type + ", "
         + "id=" + id + ", "
         + "field=" + field + ", "
         + "percentile=" + percentile
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof Percentile) {
      Percentile that = (Percentile) o;
      return (this.type.equals(that.type()))
           && (this.id.equals(that.id()))
           && (this.field.equals(that.field()))
           && (this.percentile.equals(that.percentile()));
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h$ = 1;
    h$ *= 1000003;
    h$ ^= type.hashCode();
    h$ *= 1000003;
    h$ ^= id.hashCode();
    h$ *= 1000003;
    h$ ^= field.hashCode();
    h$ *= 1000003;
    h$ ^= percentile.hashCode();
    return h$;
  }

  static final class Builder extends Percentile.Builder {
    private String type;
    private String id;
    private String field;
    private Double percentile;
    Builder() {
    }
    @Override
    public Percentile.Builder type(String type) {
      if (type == null) {
        throw new NullPointerException("Null type");
      }
      this.type = type;
      return this;
    }
    @Override
    public Percentile.Builder id(@Nullable String id) {
      if (id == null) {
        throw new NullPointerException("Null id");
      }
      this.id = id;
      return this;
    }
    @Override
    Optional id() {
      if (id == null) {
        return Optional.empty();
      } else {
        return Optional.of(id);
      }
    }
    @Override
    public Percentile.Builder field(String field) {
      if (field == null) {
        throw new NullPointerException("Null field");
      }
      this.field = field;
      return this;
    }
    @Override
    String field() {
      if (field == null) {
        throw new IllegalStateException("Property \"field\" has not been set");
      }
      return field;
    }
    @Override
    public Percentile.Builder percentile(Double percentile) {
      if (percentile == null) {
        throw new NullPointerException("Null percentile");
      }
      this.percentile = percentile;
      return this;
    }
    @Override
    Double percentile() {
      if (percentile == null) {
        throw new IllegalStateException("Property \"percentile\" has not been set");
      }
      return percentile;
    }
    @Override
    Percentile autoBuild() {
      String missing = "";
      if (this.type == null) {
        missing += " type";
      }
      if (this.id == null) {
        missing += " id";
      }
      if (this.field == null) {
        missing += " field";
      }
      if (this.percentile == null) {
        missing += " percentile";
      }
      if (!missing.isEmpty()) {
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_Percentile(
          this.type,
          this.id,
          this.field,
          this.percentile);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy