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

org.graylog.plugins.views.search.searchtypes.pivot.buckets.AutoValue_DateRangeBucket Maven / Gradle / Ivy

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

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

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

  private final DateRangeBucket.BucketKey bucketKey;

  private final String type;

  private final String field;

  private final List ranges;

  private AutoValue_DateRangeBucket(
      DateRangeBucket.BucketKey bucketKey,
      String type,
      String field,
      List ranges) {
    this.bucketKey = bucketKey;
    this.type = type;
    this.field = field;
    this.ranges = ranges;
  }

  @JsonProperty
  @Override
  public DateRangeBucket.BucketKey bucketKey() {
    return bucketKey;
  }

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

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

  @JsonProperty
  @Override
  public List ranges() {
    return ranges;
  }

  @Override
  public String toString() {
    return "DateRangeBucket{"
        + "bucketKey=" + bucketKey + ", "
        + "type=" + type + ", "
        + "field=" + field + ", "
        + "ranges=" + ranges
        + "}";
  }

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

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

  static final class Builder extends DateRangeBucket.Builder {
    private DateRangeBucket.BucketKey bucketKey;
    private String type;
    private String field;
    private List ranges;
    Builder() {
    }
    @Override
    public DateRangeBucket.Builder bucketKey(DateRangeBucket.BucketKey bucketKey) {
      if (bucketKey == null) {
        throw new NullPointerException("Null bucketKey");
      }
      this.bucketKey = bucketKey;
      return this;
    }
    @Override
    public DateRangeBucket.Builder type(String type) {
      if (type == null) {
        throw new NullPointerException("Null type");
      }
      this.type = type;
      return this;
    }
    @Override
    public DateRangeBucket.Builder field(String field) {
      if (field == null) {
        throw new NullPointerException("Null field");
      }
      this.field = field;
      return this;
    }
    @Override
    public DateRangeBucket.Builder ranges(List ranges) {
      if (ranges == null) {
        throw new NullPointerException("Null ranges");
      }
      this.ranges = ranges;
      return this;
    }
    @Override
    public DateRangeBucket build() {
      String missing = "";
      if (this.bucketKey == null) {
        missing += " bucketKey";
      }
      if (this.type == null) {
        missing += " type";
      }
      if (this.field == null) {
        missing += " field";
      }
      if (this.ranges == null) {
        missing += " ranges";
      }
      if (!missing.isEmpty()) {
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_DateRangeBucket(
          this.bucketKey,
          this.type,
          this.field,
          this.ranges);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy