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

org.graylog.plugins.views.search.searchtypes.pivot.series.AutoValue_Count 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_Count extends Count {

  private final String type;

  private final String id;

  private final String field;

  private AutoValue_Count(
      String type,
      String id,
      @Nullable String field) {
    this.type = type;
    this.id = id;
    this.field = field;
  }

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

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

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

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

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

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

  static final class Builder extends Count.Builder {
    private String type;
    private String id;
    private String field;
    Builder() {
    }
    @Override
    public Count.Builder type(String type) {
      if (type == null) {
        throw new NullPointerException("Null type");
      }
      this.type = type;
      return this;
    }
    @Override
    public Count.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 Count.Builder field(@Nullable String field) {
      this.field = field;
      return this;
    }
    @Override
    @Nullable String field() {
      return field;
    }
    @Override
    Count autoBuild() {
      String missing = "";
      if (this.type == null) {
        missing += " type";
      }
      if (this.id == null) {
        missing += " id";
      }
      if (!missing.isEmpty()) {
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_Count(
          this.type,
          this.id,
          this.field);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy