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

org.graylog.util.AutoValue_Hostname Maven / Gradle / Ivy

There is a newer version: 6.1.4
Show newest version
package org.graylog.util;

import javax.annotation.processing.Generated;

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

  private final String hostname;

  private final String canonicalHostname;

  AutoValue_Hostname(
      String hostname,
      String canonicalHostname) {
    if (hostname == null) {
      throw new NullPointerException("Null hostname");
    }
    this.hostname = hostname;
    if (canonicalHostname == null) {
      throw new NullPointerException("Null canonicalHostname");
    }
    this.canonicalHostname = canonicalHostname;
  }

  @Override
  public String hostname() {
    return hostname;
  }

  @Override
  public String canonicalHostname() {
    return canonicalHostname;
  }

  @Override
  public String toString() {
    return "Hostname{"
        + "hostname=" + hostname + ", "
        + "canonicalHostname=" + canonicalHostname
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof Hostname) {
      Hostname that = (Hostname) o;
      return this.hostname.equals(that.hostname())
          && this.canonicalHostname.equals(that.canonicalHostname());
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h$ = 1;
    h$ *= 1000003;
    h$ ^= hostname.hashCode();
    h$ *= 1000003;
    h$ ^= canonicalHostname.hashCode();
    return h$;
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy