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

org.graylog2.lookup.caches.$AutoValue_CaffeineLookupCache_Config Maven / Gradle / Ivy

There is a newer version: 6.1.4
Show newest version
package org.graylog2.lookup.caches;

import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.concurrent.TimeUnit;
import javax.annotation.Nullable;
import javax.annotation.processing.Generated;
import javax.validation.constraints.Min;

@Generated("com.google.auto.value.processor.AutoValueProcessor")
abstract class $AutoValue_CaffeineLookupCache_Config extends CaffeineLookupCache.Config {

  private final String type;

  private final @Min(0L) int maxSize;

  private final @Min(0L) long expireAfterAccess;

  @Nullable
  private final TimeUnit expireAfterAccessUnit;

  private final @Min(0L) long expireAfterWrite;

  @Nullable
  private final TimeUnit expireAfterWriteUnit;

  @Nullable
  private final Boolean ignoreNull;

  $AutoValue_CaffeineLookupCache_Config(
      String type,
      @Min(0L) int maxSize,
      @Min(0L) long expireAfterAccess,
      @Nullable TimeUnit expireAfterAccessUnit,
      @Min(0L) long expireAfterWrite,
      @Nullable TimeUnit expireAfterWriteUnit,
      @Nullable Boolean ignoreNull) {
    if (type == null) {
      throw new NullPointerException("Null type");
    }
    this.type = type;
    this.maxSize = maxSize;
    this.expireAfterAccess = expireAfterAccess;
    this.expireAfterAccessUnit = expireAfterAccessUnit;
    this.expireAfterWrite = expireAfterWrite;
    this.expireAfterWriteUnit = expireAfterWriteUnit;
    this.ignoreNull = ignoreNull;
  }

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

  @JsonProperty("max_size")
  @Override
  public @Min(0L) int maxSize() {
    return maxSize;
  }

  @JsonProperty("expire_after_access")
  @Override
  public @Min(0L) long expireAfterAccess() {
    return expireAfterAccess;
  }

  @JsonProperty("expire_after_access_unit")
  @Nullable
  @Override
  public TimeUnit expireAfterAccessUnit() {
    return expireAfterAccessUnit;
  }

  @JsonProperty("expire_after_write")
  @Override
  public @Min(0L) long expireAfterWrite() {
    return expireAfterWrite;
  }

  @JsonProperty("expire_after_write_unit")
  @Nullable
  @Override
  public TimeUnit expireAfterWriteUnit() {
    return expireAfterWriteUnit;
  }

  @JsonProperty("ignore_null")
  @Nullable
  @Override
  public Boolean ignoreNull() {
    return ignoreNull;
  }

  @Override
  public String toString() {
    return "Config{"
        + "type=" + type + ", "
        + "maxSize=" + maxSize + ", "
        + "expireAfterAccess=" + expireAfterAccess + ", "
        + "expireAfterAccessUnit=" + expireAfterAccessUnit + ", "
        + "expireAfterWrite=" + expireAfterWrite + ", "
        + "expireAfterWriteUnit=" + expireAfterWriteUnit + ", "
        + "ignoreNull=" + ignoreNull
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof CaffeineLookupCache.Config) {
      CaffeineLookupCache.Config that = (CaffeineLookupCache.Config) o;
      return this.type.equals(that.type())
          && this.maxSize == that.maxSize()
          && this.expireAfterAccess == that.expireAfterAccess()
          && (this.expireAfterAccessUnit == null ? that.expireAfterAccessUnit() == null : this.expireAfterAccessUnit.equals(that.expireAfterAccessUnit()))
          && this.expireAfterWrite == that.expireAfterWrite()
          && (this.expireAfterWriteUnit == null ? that.expireAfterWriteUnit() == null : this.expireAfterWriteUnit.equals(that.expireAfterWriteUnit()))
          && (this.ignoreNull == null ? that.ignoreNull() == null : this.ignoreNull.equals(that.ignoreNull()));
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h$ = 1;
    h$ *= 1000003;
    h$ ^= type.hashCode();
    h$ *= 1000003;
    h$ ^= maxSize;
    h$ *= 1000003;
    h$ ^= (int) ((expireAfterAccess >>> 32) ^ expireAfterAccess);
    h$ *= 1000003;
    h$ ^= (expireAfterAccessUnit == null) ? 0 : expireAfterAccessUnit.hashCode();
    h$ *= 1000003;
    h$ ^= (int) ((expireAfterWrite >>> 32) ^ expireAfterWrite);
    h$ *= 1000003;
    h$ ^= (expireAfterWriteUnit == null) ? 0 : expireAfterWriteUnit.hashCode();
    h$ *= 1000003;
    h$ ^= (ignoreNull == null) ? 0 : ignoreNull.hashCode();
    return h$;
  }

  static class Builder extends CaffeineLookupCache.Config.Builder {
    private String type;
    private @Min(0L) int maxSize;
    private @Min(0L) long expireAfterAccess;
    private TimeUnit expireAfterAccessUnit;
    private @Min(0L) long expireAfterWrite;
    private TimeUnit expireAfterWriteUnit;
    private Boolean ignoreNull;
    private byte set$0;
    Builder() {
    }
    @Override
    public CaffeineLookupCache.Config.Builder type(String type) {
      if (type == null) {
        throw new NullPointerException("Null type");
      }
      this.type = type;
      return this;
    }
    @Override
    public CaffeineLookupCache.Config.Builder maxSize(int maxSize) {
      this.maxSize = maxSize;
      set$0 |= (byte) 1;
      return this;
    }
    @Override
    public CaffeineLookupCache.Config.Builder expireAfterAccess(long expireAfterAccess) {
      this.expireAfterAccess = expireAfterAccess;
      set$0 |= (byte) 2;
      return this;
    }
    @Override
    public CaffeineLookupCache.Config.Builder expireAfterAccessUnit(@Nullable TimeUnit expireAfterAccessUnit) {
      this.expireAfterAccessUnit = expireAfterAccessUnit;
      return this;
    }
    @Override
    public CaffeineLookupCache.Config.Builder expireAfterWrite(long expireAfterWrite) {
      this.expireAfterWrite = expireAfterWrite;
      set$0 |= (byte) 4;
      return this;
    }
    @Override
    public CaffeineLookupCache.Config.Builder expireAfterWriteUnit(@Nullable TimeUnit expireAfterWriteUnit) {
      this.expireAfterWriteUnit = expireAfterWriteUnit;
      return this;
    }
    @Override
    public CaffeineLookupCache.Config.Builder ignoreNull(@Nullable Boolean ignoreNull) {
      this.ignoreNull = ignoreNull;
      return this;
    }
    @Override
    public CaffeineLookupCache.Config build() {
      if (set$0 != 7
          || this.type == null) {
        StringBuilder missing = new StringBuilder();
        if (this.type == null) {
          missing.append(" type");
        }
        if ((set$0 & 1) == 0) {
          missing.append(" maxSize");
        }
        if ((set$0 & 2) == 0) {
          missing.append(" expireAfterAccess");
        }
        if ((set$0 & 4) == 0) {
          missing.append(" expireAfterWrite");
        }
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_CaffeineLookupCache_Config(
          this.type,
          this.maxSize,
          this.expireAfterAccess,
          this.expireAfterAccessUnit,
          this.expireAfterWrite,
          this.expireAfterWriteUnit,
          this.ignoreNull);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy