directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r1060892 - /directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ConnectionServerConfigurationInput.java
Date Wed, 19 Jan 2011 18:24:44 GMT
Author: pamarcelot
Date: Wed Jan 19 18:24:44 2011
New Revision: 1060892

URL: http://svn.apache.org/viewvc?rev=1060892&view=rev
Log:
Added hashCode() and equals() methods.
Helps the Server Configuration Editor to know if the editor for an identical editor already
exists.

Modified:
    directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ConnectionServerConfigurationInput.java

Modified: directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ConnectionServerConfigurationInput.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ConnectionServerConfigurationInput.java?rev=1060892&r1=1060891&r2=1060892&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ConnectionServerConfigurationInput.java
(original)
+++ directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ConnectionServerConfigurationInput.java
Wed Jan 19 18:24:44 2011
@@ -142,4 +142,41 @@ public class ConnectionServerConfigurati
     {
         return null;
     }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean equals( Object obj )
+    {
+        if ( obj == null )
+        {
+            return false;
+        }
+
+        if ( obj instanceof ConnectionServerConfigurationInput )
+        {
+            ConnectionServerConfigurationInput input = ( ConnectionServerConfigurationInput
) obj;
+            if ( input.exists() && exists() )
+            {
+                Connection inputConnection = input.getConnection();
+
+                if ( ( inputConnection != null ) && ( inputConnection != null ) )
+                {
+                    return inputConnection.equals( connection );
+                }
+            }
+        }
+
+        return false;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public int hashCode()
+    {
+        return connection.hashCode();
+    }
 }



Mime
View raw message