mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Jean-Noel Rouvignac
23.51.2015 e1cd6c2bc4addf80537e31f929118ac8f908ea63
opendj-server-legacy/src/main/java/org/opends/admin/ads/util/PreferredConnection.java
@@ -22,9 +22,8 @@
 *
 *
 *      Copyright 2008-2009 Sun Microsystems, Inc.
 *      Portions Copyright 2013 ForgeRock AS.
 *      Portions Copyright 2013-2015 ForgeRock AS.
 */
package org.opends.admin.ads.util;
import java.util.LinkedHashSet;
@@ -38,27 +37,20 @@
 */
public class PreferredConnection
{
  private String ldapUrl;
  private Type type;
  /**
   * The type of the connection.
   */
  /** The type of the connection. */
  public enum Type
  {
    /**
     * LDAP connection.
     */
    /** LDAP connection. */
    LDAP,
    /**
     * LDAPS connection.
     */
    /** LDAPS connection. */
    LDAPS,
    /**
     * Start TLS connection.
     */
    /** Start TLS connection. */
    START_TLS
  }
  private String ldapUrl;
  private Type type;
  /**
   * The constructor of the PreferredConnection.
   * @param ldapUrl the LDAP URL to connect to the server.
@@ -89,35 +81,26 @@
    return type;
  }
  /**
   * {@inheritDoc}
   */
  /** {@inheritDoc} */
  public int hashCode()
  {
    return (type+ldapUrl.toLowerCase()).hashCode();
  }
  /**
   * {@inheritDoc}
   */
  /** {@inheritDoc} */
  public boolean equals(Object o)
  {
    boolean equals = false;
    if (this != o)
    if (this == o)
    {
      if ((o != null) &&
      (o instanceof PreferredConnection))
      {
        PreferredConnection p = (PreferredConnection)o;
        equals = type == p.getType() &&
        ldapUrl.equalsIgnoreCase(p.getLDAPURL());
      }
      return true;
    }
    else
    if (o instanceof PreferredConnection)
    {
      equals = true;
      PreferredConnection p = (PreferredConnection)o;
      return type == p.getType()
          && ldapUrl.equalsIgnoreCase(p.getLDAPURL());
    }
    return equals;
    return false;
  }