Example usage for javax.naming Context equals

List of usage examples for javax.naming Context equals

Introduction

In this page you can find the example usage for javax.naming Context equals.

Prototype

public boolean equals(Object obj) 

Source Link

Document

Indicates whether some other object is "equal to" this one.

Usage

From source file:org.springframework.ldap.pool.DelegatingContext.java

/**
 * @see java.lang.Object#equals(java.lang.Object)
 *//*from w w  w.  j a  va  2 s.c o m*/
public boolean equals(Object obj) {
    if (this == obj) {
        return true;
    }
    if (!(obj instanceof Context)) {
        return false;
    }

    final Context thisContext = this.getInnermostDelegateContext();
    Context otherContext = (Context) obj;
    if (otherContext instanceof DelegatingContext) {
        otherContext = ((DelegatingContext) otherContext).getInnermostDelegateContext();
    }

    return thisContext == otherContext || (thisContext != null && thisContext.equals(otherContext));
}