cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r776025 - /cxf/trunk/api/src/main/java/org/apache/cxf/service/model/
Date Mon, 18 May 2009 18:02:20 GMT
Author: dkulp
Date: Mon May 18 18:02:20 2009
New Revision: 776025

URL: http://svn.apache.org/viewvc?rev=776025&view=rev
Log:
[CXF-2219] Add hashcode and equals methods to various things that appear
in hashmaps.

Modified:
    cxf/trunk/api/src/main/java/org/apache/cxf/service/model/AbstractMessageContainer.java
    cxf/trunk/api/src/main/java/org/apache/cxf/service/model/AbstractPropertiesHolder.java
    cxf/trunk/api/src/main/java/org/apache/cxf/service/model/BindingOperationInfo.java
    cxf/trunk/api/src/main/java/org/apache/cxf/service/model/FaultInfo.java
    cxf/trunk/api/src/main/java/org/apache/cxf/service/model/InterfaceInfo.java
    cxf/trunk/api/src/main/java/org/apache/cxf/service/model/MessageInfo.java
    cxf/trunk/api/src/main/java/org/apache/cxf/service/model/MessagePartInfo.java
    cxf/trunk/api/src/main/java/org/apache/cxf/service/model/OperationInfo.java

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/service/model/AbstractMessageContainer.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/AbstractMessageContainer.java?rev=776025&r1=776024&r2=776025&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/service/model/AbstractMessageContainer.java
(original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/service/model/AbstractMessageContainer.java
Mon May 18 18:02:20 2009
@@ -219,5 +219,23 @@
         return messageParts.size() + getOutOfBandParts().size();
     }
     
+    
+    public int hashCode() {
+        return mName == null ? -1 : mName.hashCode();
+    }
+    
+    public boolean equals(Object o) {
+        if (o == this) {
+            return true;
+        }
+
+        if (!(o instanceof AbstractMessageContainer)) {
+            return false;
+        }
+        AbstractMessageContainer oi = (AbstractMessageContainer)o;
+        return equals(mName, oi.mName) 
+            && equals(messageParts, oi.messageParts)
+            && equals(outOfBandParts, oi.outOfBandParts);
+    }
 
 }

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/service/model/AbstractPropertiesHolder.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/AbstractPropertiesHolder.java?rev=776025&r1=776024&r2=776025&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/service/model/AbstractPropertiesHolder.java
(original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/service/model/AbstractPropertiesHolder.java
Mon May 18 18:02:20 2009
@@ -157,4 +157,15 @@
         }
         return extensor;
     }
+    
+    
+
+    protected static final boolean equals(Object o1, Object o2) {
+        if (o1 == null && o2 != null
+            || o1 != null && o2 == null) {
+            return false;
+        }
+        return o1 == null ? true : o1.equals(o2);
+    }
+    
 }

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/service/model/BindingOperationInfo.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/BindingOperationInfo.java?rev=776025&r1=776024&r2=776025&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/service/model/BindingOperationInfo.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/service/model/BindingOperationInfo.java Mon
May 18 18:02:20 2009
@@ -140,4 +140,19 @@
             .append("]").toString();
     }
     
+    
+    public int hashCode() {
+        return opInfo.hashCode();
+    }
+    
+    public boolean equals(Object o) {
+        if (o == this) {
+            return true;
+        }
+        if (!(o instanceof BindingOperationInfo)) {
+            return false;
+        }
+        return equals(opInfo, ((BindingOperationInfo)o).opInfo);
+    }
+
 }

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/service/model/FaultInfo.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/FaultInfo.java?rev=776025&r1=776024&r2=776025&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/service/model/FaultInfo.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/service/model/FaultInfo.java Mon May 18 18:02:20
2009
@@ -35,4 +35,25 @@
     public void setFaultName(QName fname) {
         faultName = fname;
     }
+    
+    
+    
+    public int hashCode() {
+        return faultName == null ? -1 : faultName.hashCode();
+    }
+    
+    public boolean equals(Object o) {
+        if (o == this) {
+            return true;
+        }
+
+        if (!(o instanceof FaultInfo)) {
+            return false;
+        }
+        FaultInfo oi = (FaultInfo)o;
+        return equals(faultName, oi.faultName) 
+            && super.equals(o);
+    }
+    
+
 }

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/service/model/InterfaceInfo.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/InterfaceInfo.java?rev=776025&r1=776024&r2=776025&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/service/model/InterfaceInfo.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/service/model/InterfaceInfo.java Mon May 18
18:02:20 2009
@@ -113,5 +113,6 @@
     public Collection<OperationInfo> getOperations() {
         return Collections.unmodifiableCollection(operations.values());
     }   
-
+    
+    
 }

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/service/model/MessageInfo.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/MessageInfo.java?rev=776025&r1=776024&r2=776025&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/service/model/MessageInfo.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/service/model/MessageInfo.java Mon May 18 18:02:20
2009
@@ -74,7 +74,7 @@
 
     @Override
     public String toString() {
-        return "[MessageInfo " + type + mName.toString() + "]";
+        return "[MessageInfo " + type + ": " + mName.toString() + "]";
     }
 
     public Type getType() {

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/service/model/MessagePartInfo.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/MessagePartInfo.java?rev=776025&r1=776024&r2=776025&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/service/model/MessagePartInfo.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/service/model/MessagePartInfo.java Mon May
18 18:02:20 2009
@@ -137,6 +137,25 @@
             .append(getConcreteName()).toString();
     }
     
+    public int hashCode() {
+        return pname == null ? -1 : pname.hashCode();
+    }
     
+    public boolean equals(Object o) {
+        if (o == this) {
+            return true;
+        }
+        if (!(o instanceof MessagePartInfo)) {
+            return false;
+        }
+        MessagePartInfo oi = (MessagePartInfo)o;
+        return equals(pname, oi.pname) 
+            && isElement == oi.isElement
+            && equals(typeName, oi.typeName)
+            && equals(elementName, oi.elementName)
+            && equals(concreteName, oi.concreteName)
+            && equals(typeClass, oi.typeClass);
+    }
+
     
 }

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/service/model/OperationInfo.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/OperationInfo.java?rev=776025&r1=776024&r2=776025&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/service/model/OperationInfo.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/service/model/OperationInfo.java Mon May 18
18:02:20 2009
@@ -212,4 +212,25 @@
             .append(opName)
             .append("]").toString();
     }
+    
+    public int hashCode() {
+        return opName == null ? -1 : opName.hashCode();
+    }
+    
+    public boolean equals(Object o) {
+        if (o == this) {
+            return true;
+        }
+
+        if (!(o instanceof OperationInfo)) {
+            return false;
+        }
+        OperationInfo oi = (OperationInfo)o;
+        return equals(opName, oi.opName) 
+            && equals(inputMessage, oi.inputMessage)
+            && equals(outputMessage, oi.outputMessage)
+            && equals(faults, oi.faults)
+            && equals(intf.getName(), oi.intf.getName()); 
+    }
+    
 }



Mime
View raw message