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

org.graylog.plugins.views.search.views.widgets.aggregation.AutoValue_TimeUnitIntervalDTO Maven / Gradle / Ivy

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

import com.fasterxml.jackson.annotation.JsonProperty;
import javax.annotation.Generated;

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

  private final String type;

  private final int value;

  private final TimeUnitIntervalDTO.IntervalUnit unit;

  private AutoValue_TimeUnitIntervalDTO(
      String type,
      int value,
      TimeUnitIntervalDTO.IntervalUnit unit) {
    this.type = type;
    this.value = value;
    this.unit = unit;
  }

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

  @JsonProperty("value")
  @Override
  public int value() {
    return value;
  }

  @JsonProperty("unit")
  @Override
  public TimeUnitIntervalDTO.IntervalUnit unit() {
    return unit;
  }

  @Override
  public String toString() {
    return "TimeUnitIntervalDTO{"
        + "type=" + type + ", "
        + "value=" + value + ", "
        + "unit=" + unit
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof TimeUnitIntervalDTO) {
      TimeUnitIntervalDTO that = (TimeUnitIntervalDTO) o;
      return this.type.equals(that.type())
          && this.value == that.value()
          && this.unit.equals(that.unit());
    }
    return false;
  }

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

  static final class Builder extends TimeUnitIntervalDTO.Builder {
    private String type;
    private Integer value;
    private TimeUnitIntervalDTO.IntervalUnit unit;
    Builder() {
    }
    @Override
    public TimeUnitIntervalDTO.Builder type(String type) {
      if (type == null) {
        throw new NullPointerException("Null type");
      }
      this.type = type;
      return this;
    }
    @Override
    public TimeUnitIntervalDTO.Builder value(int value) {
      this.value = value;
      return this;
    }
    @Override
    public TimeUnitIntervalDTO.Builder unit(TimeUnitIntervalDTO.IntervalUnit unit) {
      if (unit == null) {
        throw new NullPointerException("Null unit");
      }
      this.unit = unit;
      return this;
    }
    @Override
    public TimeUnitIntervalDTO build() {
      String missing = "";
      if (this.type == null) {
        missing += " type";
      }
      if (this.value == null) {
        missing += " value";
      }
      if (this.unit == null) {
        missing += " unit";
      }
      if (!missing.isEmpty()) {
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_TimeUnitIntervalDTO(
          this.type,
          this.value,
          this.unit);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy