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

org.graylog.security.authservice.ldap.AutoValue_LDAPEntry Maven / Gradle / Ivy

There is a newer version: 6.1.4
Show newest version
package org.graylog.security.authservice.ldap;

import com.google.common.collect.ImmutableListMultimap;
import com.google.common.collect.ImmutableSet;
import java.util.Collection;
import javax.annotation.processing.Generated;

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

  private final String dn;

  private final String base64UniqueId;

  private final ImmutableSet objectClasses;

  private final ImmutableListMultimap attributes;

  private AutoValue_LDAPEntry(
      String dn,
      String base64UniqueId,
      ImmutableSet objectClasses,
      ImmutableListMultimap attributes) {
    this.dn = dn;
    this.base64UniqueId = base64UniqueId;
    this.objectClasses = objectClasses;
    this.attributes = attributes;
  }

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

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

  @Override
  public ImmutableSet objectClasses() {
    return objectClasses;
  }

  @Override
  public ImmutableListMultimap attributes() {
    return attributes;
  }

  @Override
  public String toString() {
    return "LDAPEntry{"
        + "dn=" + dn + ", "
        + "base64UniqueId=" + base64UniqueId + ", "
        + "objectClasses=" + objectClasses + ", "
        + "attributes=" + attributes
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof LDAPEntry) {
      LDAPEntry that = (LDAPEntry) o;
      return this.dn.equals(that.dn())
          && this.base64UniqueId.equals(that.base64UniqueId())
          && this.objectClasses.equals(that.objectClasses())
          && this.attributes.equals(that.attributes());
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h$ = 1;
    h$ *= 1000003;
    h$ ^= dn.hashCode();
    h$ *= 1000003;
    h$ ^= base64UniqueId.hashCode();
    h$ *= 1000003;
    h$ ^= objectClasses.hashCode();
    h$ *= 1000003;
    h$ ^= attributes.hashCode();
    return h$;
  }

  static final class Builder extends LDAPEntry.Builder {
    private String dn;
    private String base64UniqueId;
    private ImmutableSet objectClasses;
    private ImmutableListMultimap.Builder attributesBuilder$;
    private ImmutableListMultimap attributes;
    Builder() {
    }
    @Override
    public LDAPEntry.Builder dn(String dn) {
      if (dn == null) {
        throw new NullPointerException("Null dn");
      }
      this.dn = dn;
      return this;
    }
    @Override
    public LDAPEntry.Builder base64UniqueId(String base64UniqueId) {
      if (base64UniqueId == null) {
        throw new NullPointerException("Null base64UniqueId");
      }
      this.base64UniqueId = base64UniqueId;
      return this;
    }
    @Override
    public LDAPEntry.Builder objectClasses(Collection objectClasses) {
      this.objectClasses = ImmutableSet.copyOf(objectClasses);
      return this;
    }
    @Override
    public ImmutableListMultimap.Builder attributesBuilder() {
      if (attributesBuilder$ == null) {
        attributesBuilder$ = new ImmutableListMultimap.Builder();
      }
      return attributesBuilder$;
    }
    @Override
    public LDAPEntry build() {
      if (attributesBuilder$ != null) {
        this.attributes = attributesBuilder$.build();
      } else if (this.attributes == null) {
        this.attributes = ImmutableListMultimap.of();
      }
      if (this.dn == null
          || this.base64UniqueId == null
          || this.objectClasses == null) {
        StringBuilder missing = new StringBuilder();
        if (this.dn == null) {
          missing.append(" dn");
        }
        if (this.base64UniqueId == null) {
          missing.append(" base64UniqueId");
        }
        if (this.objectClasses == null) {
          missing.append(" objectClasses");
        }
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_LDAPEntry(
          this.dn,
          this.base64UniqueId,
          this.objectClasses,
          this.attributes);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy