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

org.graylog2.lookup.adapters.dnslookup.$AutoValue_ADnsAnswer Maven / Gradle / Ivy

There is a newer version: 5.2.7
Show newest version


package org.graylog2.lookup.adapters.dnslookup;

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

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

  private final String ipAddress;

  private final String ipVersion;

  private final long dnsTTL;

  $AutoValue_ADnsAnswer(
      String ipAddress,
      @Nullable String ipVersion,
      long dnsTTL) {
    if (ipAddress == null) {
      throw new NullPointerException("Null ipAddress");
    }
    this.ipAddress = ipAddress;
    this.ipVersion = ipVersion;
    this.dnsTTL = dnsTTL;
  }

  @JsonProperty(value = "ip_address")
  @Override
  public String ipAddress() {
    return ipAddress;
  }

  @Nullable
  @JsonProperty(value = "ip_version")
  @Override
  public String ipVersion() {
    return ipVersion;
  }

  @JsonProperty(value = "dns_ttl")
  @Override
  public long dnsTTL() {
    return dnsTTL;
  }

  @Override
  public String toString() {
    return "ADnsAnswer{"
         + "ipAddress=" + ipAddress + ", "
         + "ipVersion=" + ipVersion + ", "
         + "dnsTTL=" + dnsTTL
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof ADnsAnswer) {
      ADnsAnswer that = (ADnsAnswer) o;
      return (this.ipAddress.equals(that.ipAddress()))
           && ((this.ipVersion == null) ? (that.ipVersion() == null) : this.ipVersion.equals(that.ipVersion()))
           && (this.dnsTTL == that.dnsTTL());
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h$ = 1;
    h$ *= 1000003;
    h$ ^= ipAddress.hashCode();
    h$ *= 1000003;
    h$ ^= (ipVersion == null) ? 0 : ipVersion.hashCode();
    h$ *= 1000003;
    h$ ^= (int) ((dnsTTL >>> 32) ^ dnsTTL);
    return h$;
  }

  static final class Builder extends ADnsAnswer.Builder {
    private String ipAddress;
    private String ipVersion;
    private Long dnsTTL;
    Builder() {
    }
    @Override
    public ADnsAnswer.Builder ipAddress(String ipAddress) {
      if (ipAddress == null) {
        throw new NullPointerException("Null ipAddress");
      }
      this.ipAddress = ipAddress;
      return this;
    }
    @Override
    public ADnsAnswer.Builder ipVersion(String ipVersion) {
      this.ipVersion = ipVersion;
      return this;
    }
    @Override
    public ADnsAnswer.Builder dnsTTL(long dnsTTL) {
      this.dnsTTL = dnsTTL;
      return this;
    }
    @Override
    ADnsAnswer autoBuild() {
      String missing = "";
      if (this.ipAddress == null) {
        missing += " ipAddress";
      }
      if (this.dnsTTL == null) {
        missing += " dnsTTL";
      }
      if (!missing.isEmpty()) {
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_ADnsAnswer(
          this.ipAddress,
          this.ipVersion,
          this.dnsTTL);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy