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

org.graylog.events.processor.aggregation.AutoValue_AggregationKeyResult Maven / Gradle / Ivy

There is a newer version: 6.0.2
Show newest version
package org.graylog.events.processor.aggregation;

import com.google.common.collect.ImmutableList;
import java.util.List;
import java.util.Optional;
import javax.annotation.Generated;
import javax.annotation.Nullable;
import org.joda.time.DateTime;

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

  private final ImmutableList key;

  private final Optional timestamp;

  private final ImmutableList seriesValues;

  private AutoValue_AggregationKeyResult(
      ImmutableList key,
      Optional timestamp,
      ImmutableList seriesValues) {
    this.key = key;
    this.timestamp = timestamp;
    this.seriesValues = seriesValues;
  }

  @Override
  public ImmutableList key() {
    return key;
  }

  @Override
  public Optional timestamp() {
    return timestamp;
  }

  @Override
  public ImmutableList seriesValues() {
    return seriesValues;
  }

  @Override
  public String toString() {
    return "AggregationKeyResult{"
         + "key=" + key + ", "
         + "timestamp=" + timestamp + ", "
         + "seriesValues=" + seriesValues
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof AggregationKeyResult) {
      AggregationKeyResult that = (AggregationKeyResult) o;
      return this.key.equals(that.key())
          && this.timestamp.equals(that.timestamp())
          && this.seriesValues.equals(that.seriesValues());
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h$ = 1;
    h$ *= 1000003;
    h$ ^= key.hashCode();
    h$ *= 1000003;
    h$ ^= timestamp.hashCode();
    h$ *= 1000003;
    h$ ^= seriesValues.hashCode();
    return h$;
  }

  @Override
  public AggregationKeyResult.Builder toBuilder() {
    return new Builder(this);
  }

  static final class Builder extends AggregationKeyResult.Builder {
    private ImmutableList key;
    private Optional timestamp = Optional.empty();
    private ImmutableList seriesValues;
    Builder() {
    }
    private Builder(AggregationKeyResult source) {
      this.key = source.key();
      this.timestamp = source.timestamp();
      this.seriesValues = source.seriesValues();
    }
    @Override
    public AggregationKeyResult.Builder key(List key) {
      this.key = ImmutableList.copyOf(key);
      return this;
    }
    @Override
    public AggregationKeyResult.Builder timestamp(@Nullable DateTime timestamp) {
      this.timestamp = Optional.ofNullable(timestamp);
      return this;
    }
    @Override
    public AggregationKeyResult.Builder seriesValues(List seriesValues) {
      this.seriesValues = ImmutableList.copyOf(seriesValues);
      return this;
    }
    @Override
    public AggregationKeyResult build() {
      String missing = "";
      if (this.key == null) {
        missing += " key";
      }
      if (this.seriesValues == null) {
        missing += " seriesValues";
      }
      if (!missing.isEmpty()) {
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_AggregationKeyResult(
          this.key,
          this.timestamp,
          this.seriesValues);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy