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

org.graylog2.indexer.rotation.strategies.$AutoValue_TimeBasedRotationStrategyConfig Maven / Gradle / Ivy

There is a newer version: 6.0.1
Show newest version
package org.graylog2.indexer.rotation.strategies;

import com.fasterxml.jackson.annotation.JsonProperty;
import javax.annotation.Generated;
import javax.annotation.Nullable;
import org.joda.time.Period;

@Generated("com.google.auto.value.processor.AutoValueProcessor")
abstract class $AutoValue_TimeBasedRotationStrategyConfig extends TimeBasedRotationStrategyConfig {

  private final String type;

  private final Period rotationPeriod;

  private final Period maxRotationPeriod;

  $AutoValue_TimeBasedRotationStrategyConfig(
      String type,
      Period rotationPeriod,
      @Nullable Period maxRotationPeriod) {
    if (type == null) {
      throw new NullPointerException("Null type");
    }
    this.type = type;
    if (rotationPeriod == null) {
      throw new NullPointerException("Null rotationPeriod");
    }
    this.rotationPeriod = rotationPeriod;
    this.maxRotationPeriod = maxRotationPeriod;
  }

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

  @JsonProperty("rotation_period")
  @Override
  public Period rotationPeriod() {
    return rotationPeriod;
  }

  @JsonProperty("max_rotation_period")
  @Nullable
  @Override
  public Period maxRotationPeriod() {
    return maxRotationPeriod;
  }

  @Override
  public String toString() {
    return "TimeBasedRotationStrategyConfig{"
        + "type=" + type + ", "
        + "rotationPeriod=" + rotationPeriod + ", "
        + "maxRotationPeriod=" + maxRotationPeriod
        + "}";
  }

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

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

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy