directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ersi...@apache.org
Subject svn commit: r399595 - /directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/
Date Thu, 04 May 2006 08:01:15 GMT
Author: ersiner
Date: Thu May  4 01:01:13 2006
New Revision: 399595

URL: http://svn.apache.org/viewcvs?rev=399595&view=rev
Log:
Added hashCode() and equals() overrides. Thanks to Eclipse 3.2.

Modified:
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/ActionTime.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/LdapOperation.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/SearchScope.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/StoredProcedureLanguageOption.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/StoredProcedureParameter.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/StoredProcedureSearchContextOption.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/TriggerSpecification.java

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/ActionTime.java
URL: http://svn.apache.org/viewcvs/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/ActionTime.java?rev=399595&r1=399594&r2=399595&view=diff
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/ActionTime.java
(original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/ActionTime.java
Thu May  4 01:01:13 2006
@@ -56,4 +56,39 @@
     {
         return name;
     }
+
+
+    /* (non-Javadoc)
+     * @see java.lang.Object#hashCode()
+     */
+    public int hashCode()
+    {
+        final int PRIME = 31;
+        int result = 1;
+        result = PRIME * result + ( ( name == null ) ? 0 : name.hashCode() );
+        return result;
+    }
+
+
+    /* (non-Javadoc)
+     * @see java.lang.Object#equals(java.lang.Object)
+     */
+    public boolean equals( Object obj )
+    {
+        if ( this == obj )
+            return true;
+        if ( obj == null )
+            return false;
+        if ( getClass() != obj.getClass() )
+            return false;
+        final ActionTime other = ( ActionTime ) obj;
+        if ( name == null )
+        {
+            if ( other.name != null )
+                return false;
+        }
+        else if ( !name.equals( other.name ) )
+            return false;
+        return true;
+    }
 }

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/LdapOperation.java
URL: http://svn.apache.org/viewcvs/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/LdapOperation.java?rev=399595&r1=399594&r2=399595&view=diff
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/LdapOperation.java
(original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/LdapOperation.java
Thu May  4 01:01:13 2006
@@ -69,23 +69,40 @@
     {
         return name;
     }
-    
-    public boolean equals( Object o )
+
+
+    /* (non-Javadoc)
+     * @see java.lang.Object#hashCode()
+     */
+    public int hashCode()
     {
-        if ( this == o )
-        {
+        final int PRIME = 31;
+        int result = 1;
+        result = PRIME * result + ( ( name == null ) ? 0 : name.hashCode() );
+        return result;
+    }
+
+
+    /* (non-Javadoc)
+     * @see java.lang.Object#equals(java.lang.Object)
+     */
+    public boolean equals( Object obj )
+    {
+        if ( this == obj )
             return true;
-        }
-        
-        if ( o instanceof LdapOperation )
+        if ( obj == null )
+            return false;
+        if ( getClass() != obj.getClass() )
+            return false;
+        final LdapOperation other = ( LdapOperation ) obj;
+        if ( name == null )
         {
-            LdapOperation operation = ( LdapOperation ) o;
-            return operation.getName().equals( getName() );
-            
+            if ( other.name != null )
+                return false;
         }
-        else
-        {
+        else if ( !name.equals( other.name ) )
             return false;
-        }
+        return true;
     }
+    
 }

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/SearchScope.java
URL: http://svn.apache.org/viewcvs/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/SearchScope.java?rev=399595&r1=399594&r2=399595&view=diff
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/SearchScope.java
(original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/SearchScope.java
Thu May  4 01:01:13 2006
@@ -50,4 +50,37 @@
     {
         return name;
     }
+
+    /* (non-Javadoc)
+     * @see java.lang.Object#hashCode()
+     */
+    public int hashCode()
+    {
+        final int PRIME = 31;
+        int result = 1;
+        result = PRIME * result + ( ( name == null ) ? 0 : name.hashCode() );
+        return result;
+    }
+
+    /* (non-Javadoc)
+     * @see java.lang.Object#equals(java.lang.Object)
+     */
+    public boolean equals( Object obj )
+    {
+        if ( this == obj )
+            return true;
+        if ( obj == null )
+            return false;
+        if ( getClass() != obj.getClass() )
+            return false;
+        final SearchScope other = ( SearchScope ) obj;
+        if ( name == null )
+        {
+            if ( other.name != null )
+                return false;
+        }
+        else if ( !name.equals( other.name ) )
+            return false;
+        return true;
+    }
 }

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/StoredProcedureLanguageOption.java
URL: http://svn.apache.org/viewcvs/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/StoredProcedureLanguageOption.java?rev=399595&r1=399594&r2=399595&view=diff
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/StoredProcedureLanguageOption.java
(original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/StoredProcedureLanguageOption.java
Thu May  4 01:01:13 2006
@@ -38,29 +38,37 @@
         return language;
     }
 
+    /* (non-Javadoc)
+     * @see java.lang.Object#hashCode()
+     */
+    public int hashCode()
+    {
+        final int PRIME = 31;
+        int result = 1;
+        result = PRIME * result + ( ( language == null ) ? 0 : language.hashCode() );
+        return result;
+    }
+
+    /* (non-Javadoc)
+     * @see java.lang.Object#equals(java.lang.Object)
+     */
     public boolean equals( Object obj )
     {
-        if ( obj == this )
-        {
+        if ( this == obj )
             return true;
-        }
-        
-        if ( obj instanceof StoredProcedureLanguageOption )
+        if ( obj == null )
+            return false;
+        if ( getClass() != obj.getClass() )
+            return false;
+        final StoredProcedureLanguageOption other = ( StoredProcedureLanguageOption ) obj;
+        if ( language == null )
         {
-            StoredProcedureLanguageOption splo = ( StoredProcedureLanguageOption ) obj; 
-            if ( splo.getLanguage().equals( this.getLanguage() ) )
-            {
-                return true;
-            }
-            else
-            {
+            if ( other.language != null )
                 return false;
-            }
         }
-        else
-        {
+        else if ( !language.equals( other.language ) )
             return false;
-        }
+        return true;
     }
 
 }

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/StoredProcedureParameter.java
URL: http://svn.apache.org/viewcvs/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/StoredProcedureParameter.java?rev=399595&r1=399594&r2=399595&view=diff
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/StoredProcedureParameter.java
(original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/StoredProcedureParameter.java
Thu May  4 01:01:13 2006
@@ -55,6 +55,41 @@
         return name;
     }
     
+
+    /* (non-Javadoc)
+     * @see java.lang.Object#hashCode()
+     */
+    public int hashCode()
+    {
+        final int PRIME = 31;
+        int result = 1;
+        result = PRIME * result + ( ( name == null ) ? 0 : name.hashCode() );
+        return result;
+    }
+
+
+    /* (non-Javadoc)
+     * @see java.lang.Object#equals(java.lang.Object)
+     */
+    public boolean equals( Object obj )
+    {
+        if ( this == obj )
+            return true;
+        if ( obj == null )
+            return false;
+        if ( getClass() != obj.getClass() )
+            return false;
+        final StoredProcedureParameter other = ( StoredProcedureParameter ) obj;
+        if ( name == null )
+        {
+            if ( other.name != null )
+                return false;
+        }
+        else if ( !name.equals( other.name ) )
+            return false;
+        return true;
+    }
+    
     // Operation Specific Subclasses
 
     public static class BindStoredProcedureParameter extends StoredProcedureParameter

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/StoredProcedureSearchContextOption.java
URL: http://svn.apache.org/viewcvs/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/StoredProcedureSearchContextOption.java?rev=399595&r1=399594&r2=399595&view=diff
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/StoredProcedureSearchContextOption.java
(original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/StoredProcedureSearchContextOption.java
Thu May  4 01:01:13 2006
@@ -59,29 +59,45 @@
         return baseObject.toString();
     }
 
+    /* (non-Javadoc)
+     * @see java.lang.Object#hashCode()
+     */
+    public int hashCode()
+    {
+        final int PRIME = 31;
+        int result = 1;
+        result = PRIME * result + ( ( baseObject == null ) ? 0 : baseObject.hashCode() );
+        result = PRIME * result + ( ( searchScope == null ) ? 0 : searchScope.hashCode()
);
+        return result;
+    }
+
+    /* (non-Javadoc)
+     * @see java.lang.Object#equals(java.lang.Object)
+     */
     public boolean equals( Object obj )
     {
-        if ( obj == this )
-        {
+        if ( this == obj )
             return true;
-        }
-        
-        if ( obj instanceof StoredProcedureSearchContextOption )
+        if ( obj == null )
+            return false;
+        if ( getClass() != obj.getClass() )
+            return false;
+        final StoredProcedureSearchContextOption other = ( StoredProcedureSearchContextOption
) obj;
+        if ( baseObject == null )
         {
-            StoredProcedureSearchContextOption stsco = ( StoredProcedureSearchContextOption
) obj;
-            if ( stsco.getBaseObject().equals( this.getBaseObject() ) && stsco.getSearchScope().equals(
this.getSearchScope() ) )
-            {
-                return true;
-            }
-            else
-            {
+            if ( other.baseObject != null )
                 return false;
-            }
         }
-        else
-        {
+        else if ( !baseObject.equals( other.baseObject ) )
             return false;
+        if ( searchScope == null )
+        {
+            if ( other.searchScope != null )
+                return false;
         }
+        else if ( !searchScope.equals( other.searchScope ) )
+            return false;
+        return true;
     }
     
 }

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/TriggerSpecification.java
URL: http://svn.apache.org/viewcvs/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/TriggerSpecification.java?rev=399595&r1=399594&r2=399595&view=diff
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/TriggerSpecification.java
(original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/trigger/TriggerSpecification.java
Thu May  4 01:01:13 2006
@@ -72,5 +72,70 @@
     {
         return storedProcedureParameters;
     }
+
+    /* (non-Javadoc)
+     * @see java.lang.Object#hashCode()
+     */
+    public int hashCode()
+    {
+        final int PRIME = 31;
+        int result = 1;
+        result = PRIME * result + ( ( actionTime == null ) ? 0 : actionTime.hashCode() );
+        result = PRIME * result + ( ( ldapOperation == null ) ? 0 : ldapOperation.hashCode()
);
+        result = PRIME * result + ( ( storedProcedureName == null ) ? 0 : storedProcedureName.hashCode()
);
+        result = PRIME * result + ( ( storedProcedureOptions == null ) ? 0 : storedProcedureOptions.hashCode()
);
+        result = PRIME * result + ( ( storedProcedureParameters == null ) ? 0 : storedProcedureParameters.hashCode()
);
+        return result;
+    }
+
+    /* (non-Javadoc)
+     * @see java.lang.Object#equals(java.lang.Object)
+     */
+    public boolean equals( Object obj )
+    {
+        if ( this == obj )
+            return true;
+        if ( obj == null )
+            return false;
+        if ( getClass() != obj.getClass() )
+            return false;
+        final TriggerSpecification other = ( TriggerSpecification ) obj;
+        if ( actionTime == null )
+        {
+            if ( other.actionTime != null )
+                return false;
+        }
+        else if ( !actionTime.equals( other.actionTime ) )
+            return false;
+        if ( ldapOperation == null )
+        {
+            if ( other.ldapOperation != null )
+                return false;
+        }
+        else if ( !ldapOperation.equals( other.ldapOperation ) )
+            return false;
+        if ( storedProcedureName == null )
+        {
+            if ( other.storedProcedureName != null )
+                return false;
+        }
+        else if ( !storedProcedureName.equals( other.storedProcedureName ) )
+            return false;
+        if ( storedProcedureOptions == null )
+        {
+            if ( other.storedProcedureOptions != null )
+                return false;
+        }
+        else if ( !storedProcedureOptions.equals( other.storedProcedureOptions ) )
+            return false;
+        if ( storedProcedureParameters == null )
+        {
+            if ( other.storedProcedureParameters != null )
+                return false;
+        }
+        else if ( !storedProcedureParameters.equals( other.storedProcedureParameters ) )
+            return false;
+        return true;
+    }
     
 }



Mime
View raw message