You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by ch...@apache.org on 2015/08/19 10:07:22 UTC

olingo-odata4 git commit: [OLINGO-735] Remove reflection equals from client item

Repository: olingo-odata4
Updated Branches:
  refs/heads/master 73f717d55 -> a1731b7ef


[OLINGO-735] Remove reflection equals from client item


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/a1731b7e
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/a1731b7e
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/a1731b7e

Branch: refs/heads/master
Commit: a1731b7efefbda0bf9574d6a82b51a9ab77bb010
Parents: 73f717d
Author: Christian Amend <ch...@sap.com>
Authored: Wed Aug 19 09:27:31 2015 +0200
Committer: Christian Amend <ch...@sap.com>
Committed: Wed Aug 19 10:07:12 2015 +0200

----------------------------------------------------------------------
 .../api/domain/AbstractClientPayload.java       |  35 +++++
 .../client/api/domain/AbstractClientValue.java  |  35 +++--
 .../client/api/domain/ClientInlineEntity.java   |  35 +++++
 .../api/domain/ClientInlineEntitySet.java       |  40 +++++-
 .../olingo/client/api/domain/ClientItem.java    |  50 ++++---
 .../core/domain/AbstractClientEntitySet.java    |  43 ++++++
 .../core/domain/ClientCollectionValueImpl.java  |  33 +++++
 .../core/domain/ClientComplexValueImpl.java     |  60 ++++++++
 .../core/domain/ClientDeletedEntityImpl.java    |  39 ++++++
 .../client/core/domain/ClientDeltaImpl.java     |  51 +++++++
 .../client/core/domain/ClientDeltaLinkImpl.java |  60 ++++++++
 .../client/core/domain/ClientEntityImpl.java    | 139 +++++++++++++++++++
 .../client/core/domain/ClientEntitySetImpl.java |  51 +++++++
 .../client/core/domain/ClientEnumValueImpl.java |  29 ++++
 .../core/domain/ClientPrimitiveValueImpl.java   |  42 ++++++
 .../client/core/domain/ClientPropertyImpl.java  |  52 ++++---
 16 files changed, 751 insertions(+), 43 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a1731b7e/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/AbstractClientPayload.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/AbstractClientPayload.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/AbstractClientPayload.java
index 994bea4..471e53c 100644
--- a/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/AbstractClientPayload.java
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/AbstractClientPayload.java
@@ -47,4 +47,39 @@ public abstract class AbstractClientPayload extends ClientItem {
   public void setContextURL(final URI contextURL) {
     this.contextURL = contextURL;
   }
+
+  @Override
+  public int hashCode() {
+    final int prime = 31;
+    int result = super.hashCode();
+    result = prime * result + ((contextURL == null) ? 0 : contextURL.hashCode());
+    return result;
+  }
+
+  @Override
+  public boolean equals(Object obj) {
+    if (this == obj) {
+      return true;
+    }
+    if (!super.equals(obj)) {
+      return false;
+    }
+    if (!(obj instanceof AbstractClientPayload)) {
+      return false;
+    }
+    AbstractClientPayload other = (AbstractClientPayload) obj;
+    if (contextURL == null) {
+      if (other.contextURL != null) {
+        return false;
+      }
+    } else if (!contextURL.equals(other.contextURL)) {
+      return false;
+    }
+    return true;
+  }
+
+  @Override
+  public String toString() {
+    return "AbstractClientPayload [contextURL=" + contextURL + "super[" + super.toString() + "]]";
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a1731b7e/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/AbstractClientValue.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/AbstractClientValue.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/AbstractClientValue.java
index dca1904..16d54cc 100644
--- a/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/AbstractClientValue.java
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/AbstractClientValue.java
@@ -18,11 +18,6 @@
  */
 package org.apache.olingo.client.api.domain;
 
-import org.apache.commons.lang3.builder.EqualsBuilder;
-import org.apache.commons.lang3.builder.HashCodeBuilder;
-import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
-import org.apache.commons.lang3.builder.ToStringStyle;
-
 /**
  * Abstract representation of an OData entity property value.
  */
@@ -103,18 +98,40 @@ public abstract class AbstractClientValue implements ClientValue {
     return isCollection() ? (ClientCollectionValue<OV>) this : null;
   }
 
+  
+  
   @Override
-  public boolean equals(final Object obj) {
-    return EqualsBuilder.reflectionEquals(this, obj);
+  public boolean equals(Object obj) {
+    if (this == obj) {
+      return true;
+    }
+    if (obj == null) {
+      return false;
+    }
+    if (!(obj instanceof AbstractClientValue)) {
+      return false;
+    }
+    AbstractClientValue other = (AbstractClientValue) obj;
+    if (typeName == null) {
+      if (other.typeName != null) {
+        return false;
+      }
+    } else if (!typeName.equals(other.typeName)) {
+      return false;
+    }
+    return true;
   }
 
   @Override
   public int hashCode() {
-    return HashCodeBuilder.reflectionHashCode(this);
+    final int prime = 31;
+    int result = 1;
+    result = prime * result + ((typeName == null) ? 0 : typeName.hashCode());
+    return result;
   }
 
   @Override
   public String toString() {
-    return ReflectionToStringBuilder.toString(this, ToStringStyle.MULTI_LINE_STYLE);
+    return "AbstractClientValue [typeName=" + typeName + "]";
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a1731b7e/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ClientInlineEntity.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ClientInlineEntity.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ClientInlineEntity.java
index b5ff829..e24a19c 100644
--- a/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ClientInlineEntity.java
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ClientInlineEntity.java
@@ -65,4 +65,39 @@ public class ClientInlineEntity extends ClientLink {
   public ClientEntity getEntity() {
     return entity;
   }
+
+  @Override
+  public int hashCode() {
+    final int prime = 31;
+    int result = super.hashCode();
+    result = prime * result + ((entity == null) ? 0 : entity.hashCode());
+    return result;
+  }
+
+  @Override
+  public boolean equals(Object obj) {
+    if (this == obj) {
+      return true;
+    }
+    if (!super.equals(obj)) {
+      return false;
+    }
+    if (!(obj instanceof ClientInlineEntity)) {
+      return false;
+    }
+    ClientInlineEntity other = (ClientInlineEntity) obj;
+    if (entity == null) {
+      if (other.entity != null) {
+        return false;
+      }
+    } else if (!entity.equals(other.entity)) {
+      return false;
+    }
+    return true;
+  }
+
+  @Override
+  public String toString() {
+    return "ClientInlineEntity [entity=" + entity + "super[" + super.toString() + "]]";
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a1731b7e/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ClientInlineEntitySet.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ClientInlineEntitySet.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ClientInlineEntitySet.java
index 28c4ee6..dbb5f67 100644
--- a/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ClientInlineEntitySet.java
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ClientInlineEntitySet.java
@@ -36,7 +36,7 @@ public class ClientInlineEntitySet extends ClientLink {
    * @param entitySet entity set.
    */
   public ClientInlineEntitySet(final URI uri, final ClientLinkType type,
-                               final String title, final ClientEntitySet entitySet) {
+      final String title, final ClientEntitySet entitySet) {
 
     super(uri, type, title);
     this.entitySet = entitySet;
@@ -52,7 +52,7 @@ public class ClientInlineEntitySet extends ClientLink {
    * @param entitySet entity set.
    */
   public ClientInlineEntitySet(final URI baseURI, final String href,
-                               final ClientLinkType type, final String title, final ClientEntitySet entitySet) {
+      final ClientLinkType type, final String title, final ClientEntitySet entitySet) {
 
     super(baseURI, href, type, title);
     this.entitySet = entitySet;
@@ -66,4 +66,40 @@ public class ClientInlineEntitySet extends ClientLink {
   public ClientEntitySet getEntitySet() {
     return entitySet;
   }
+
+  @Override
+  public int hashCode() {
+    final int prime = 31;
+    int result = super.hashCode();
+    result = prime * result + ((entitySet == null) ? 0 : entitySet.hashCode());
+    return result;
+  }
+
+  @Override
+  public boolean equals(Object obj) {
+    if (this == obj) {
+      return true;
+    }
+    if (!super.equals(obj)) {
+      return false;
+    }
+    if (!(obj instanceof ClientInlineEntitySet)) {
+      return false;
+    }
+    ClientInlineEntitySet other = (ClientInlineEntitySet) obj;
+    if (entitySet == null) {
+      if (other.entitySet != null) {
+        return false;
+      }
+    } else if (!entitySet.equals(other.entitySet)) {
+      return false;
+    }
+    return true;
+  }
+
+  @Override
+  public String toString() {
+    return "ClientInlineEntitySet [entitySet=" + entitySet + "super[" + super.toString() + "]]";
+  }
+
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a1731b7e/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ClientItem.java
----------------------------------------------------------------------
diff --git a/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ClientItem.java b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ClientItem.java
index a50053a..d60c8b8 100644
--- a/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ClientItem.java
+++ b/lib/client-api/src/main/java/org/apache/olingo/client/api/domain/ClientItem.java
@@ -20,24 +20,12 @@ package org.apache.olingo.client.api.domain;
 
 import java.net.URI;
 
-import org.apache.commons.lang3.builder.EqualsBuilder;
-import org.apache.commons.lang3.builder.HashCodeBuilder;
-import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
-import org.apache.commons.lang3.builder.ToStringStyle;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 /**
  * Abstract representation of OData entities and links.
  */
 public abstract class ClientItem {
 
   /**
-   * Logger.
-   */
-  protected static final Logger LOG = LoggerFactory.getLogger(ClientItem.class);
-
-  /**
    * OData entity name/type.
    */
   private final String name;
@@ -79,18 +67,48 @@ public abstract class ClientItem {
     this.link = link;
   }
 
+
+
   @Override
-  public boolean equals(final Object obj) {
-    return EqualsBuilder.reflectionEquals(this, obj);
+  public boolean equals(Object obj) {
+    if (this == obj) {
+      return true;
+    }
+    if (obj == null) {
+      return false;
+    }
+    if (!(obj instanceof ClientItem)) {
+      return false;
+    }
+    ClientItem other = (ClientItem) obj;
+    if (link == null) {
+      if (other.link != null) {
+        return false;
+      }
+    } else if (!link.equals(other.link)) {
+      return false;
+    }
+    if (name == null) {
+      if (other.name != null) {
+        return false;
+      }
+    } else if (!name.equals(other.name)) {
+      return false;
+    }
+    return true;
   }
 
   @Override
   public int hashCode() {
-    return HashCodeBuilder.reflectionHashCode(this);
+    final int prime = 31;
+    int result = 1;
+    result = prime * result + ((link == null) ? 0 : link.hashCode());
+    result = prime * result + ((name == null) ? 0 : name.hashCode());
+    return result;
   }
 
   @Override
   public String toString() {
-    return ReflectionToStringBuilder.toString(this, ToStringStyle.MULTI_LINE_STYLE);
+    return "ClientItem [name=" + name + ", link=" + link + "]";
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a1731b7e/lib/client-core/src/main/java/org/apache/olingo/client/core/domain/AbstractClientEntitySet.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/domain/AbstractClientEntitySet.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/domain/AbstractClientEntitySet.java
index d6b81d9..b57960a 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/domain/AbstractClientEntitySet.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/domain/AbstractClientEntitySet.java
@@ -68,4 +68,47 @@ public abstract class AbstractClientEntitySet extends AbstractClientPayload impl
   public void setCount(final int count) {
     this.count = count;
   }
+
+  @Override
+  public int hashCode() {
+    final int prime = 31;
+    int result = super.hashCode();
+    result = prime * result + ((count == null) ? 0 : count.hashCode());
+    result = prime * result + ((next == null) ? 0 : next.hashCode());
+    return result;
+  }
+
+  @Override
+  public boolean equals(Object obj) {
+    if (this == obj) {
+      return true;
+    }
+    if (!super.equals(obj)) {
+      return false;
+    }
+    if (!(obj instanceof AbstractClientEntitySet)) {
+      return false;
+    }
+    AbstractClientEntitySet other = (AbstractClientEntitySet) obj;
+    if (count == null) {
+      if (other.count != null) {
+        return false;
+      }
+    } else if (!count.equals(other.count)) {
+      return false;
+    }
+    if (next == null) {
+      if (other.next != null) {
+        return false;
+      }
+    } else if (!next.equals(other.next)) {
+      return false;
+    }
+    return true;
+  }
+
+  @Override
+  public String toString() {
+    return "AbstractClientEntitySet [next=" + next + ", count=" + count + "super[" + super.toString() + "]]";
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a1731b7e/lib/client-core/src/main/java/org/apache/olingo/client/core/domain/ClientCollectionValueImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/domain/ClientCollectionValueImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/domain/ClientCollectionValueImpl.java
index 3698060..c83fceb 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/domain/ClientCollectionValueImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/domain/ClientCollectionValueImpl.java
@@ -120,5 +120,38 @@ public class ClientCollectionValueImpl<OV extends ClientValue> extends AbstractC
     return values.isEmpty();
   }
 
+  @Override
+  public int hashCode() {
+    final int prime = 31;
+    int result = super.hashCode();
+    result = prime * result + ((values == null) ? 0 : values.hashCode());
+    return result;
+  }
 
+  @Override
+  public boolean equals(Object obj) {
+    if (this == obj) {
+      return true;
+    }
+    if (!super.equals(obj)) {
+      return false;
+    }
+    if (!(obj instanceof ClientCollectionValueImpl)) {
+      return false;
+    }
+    ClientCollectionValueImpl<?> other = (ClientCollectionValueImpl<?>) obj;
+    if (values == null) {
+      if (other.values != null) {
+        return false;
+      }
+    } else if (!values.equals(other.values)) {
+      return false;
+    }
+    return true;
+  }
+
+  @Override
+  public String toString() {
+    return "ClientCollectionValueImpl [values=" + values + "super[" + super.toString() + "]]";
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a1731b7e/lib/client-core/src/main/java/org/apache/olingo/client/core/domain/ClientComplexValueImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/domain/ClientComplexValueImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/domain/ClientComplexValueImpl.java
index d7550b6..9cd083e 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/domain/ClientComplexValueImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/domain/ClientComplexValueImpl.java
@@ -201,4 +201,64 @@ public class ClientComplexValueImpl extends AbstractClientValue implements Clien
   public int size() {
     return fields.size();
   }
+
+  @Override
+  public int hashCode() {
+    final int prime = 31;
+    int result = super.hashCode();
+    result = prime * result + ((annotations == null) ? 0 : annotations.hashCode());
+    result = prime * result + ((associationLinks == null) ? 0 : associationLinks.hashCode());
+    result = prime * result + ((fields == null) ? 0 : fields.hashCode());
+    result = prime * result + ((navigationLinks == null) ? 0 : navigationLinks.hashCode());
+    return result;
+  }
+
+  @Override
+  public boolean equals(Object obj) {
+    if (this == obj) {
+      return true;
+    }
+    if (!super.equals(obj)) {
+      return false;
+    }
+    if (!(obj instanceof ClientComplexValueImpl)) {
+      return false;
+    }
+    ClientComplexValueImpl other = (ClientComplexValueImpl) obj;
+    if (annotations == null) {
+      if (other.annotations != null) {
+        return false;
+      }
+    } else if (!annotations.equals(other.annotations)) {
+      return false;
+    }
+    if (associationLinks == null) {
+      if (other.associationLinks != null) {
+        return false;
+      }
+    } else if (!associationLinks.equals(other.associationLinks)) {
+      return false;
+    }
+    if (fields == null) {
+      if (other.fields != null) {
+        return false;
+      }
+    } else if (!fields.equals(other.fields)) {
+      return false;
+    }
+    if (navigationLinks == null) {
+      if (other.navigationLinks != null) {
+        return false;
+      }
+    } else if (!navigationLinks.equals(other.navigationLinks)) {
+      return false;
+    }
+    return true;
+  }
+
+  @Override
+  public String toString() {
+    return "ClientComplexValueImpl [navigationLinks=" + navigationLinks + ", associationLinks=" + associationLinks
+        + ", annotations=" + annotations + ", fields=" + fields + "super[" + super.toString() + "]]";
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a1731b7e/lib/client-core/src/main/java/org/apache/olingo/client/core/domain/ClientDeletedEntityImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/domain/ClientDeletedEntityImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/domain/ClientDeletedEntityImpl.java
index e2d954b..e1cf69f 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/domain/ClientDeletedEntityImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/domain/ClientDeletedEntityImpl.java
@@ -51,4 +51,43 @@ public class ClientDeletedEntityImpl extends ClientItem implements ClientDeleted
     this.reason = reason;
   }
 
+  @Override
+  public int hashCode() {
+    final int prime = 31;
+    int result = super.hashCode();
+    result = prime * result + ((id == null) ? 0 : id.hashCode());
+    result = prime * result + ((reason == null) ? 0 : reason.hashCode());
+    return result;
+  }
+
+  @Override
+  public boolean equals(Object obj) {
+    if (this == obj) {
+      return true;
+    }
+    if (!super.equals(obj)) {
+      return false;
+    }
+    if (!(obj instanceof ClientDeletedEntityImpl)) {
+      return false;
+    }
+    ClientDeletedEntityImpl other = (ClientDeletedEntityImpl) obj;
+    if (id == null) {
+      if (other.id != null) {
+        return false;
+      }
+    } else if (!id.equals(other.id)) {
+      return false;
+    }
+    if (reason != other.reason) {
+      return false;
+    }
+    return true;
+  }
+
+  @Override
+  public String toString() {
+    return "ClientDeletedEntityImpl [id=" + id + ", reason=" + reason + "super[" + super.toString() + "]]";
+  }
+
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a1731b7e/lib/client-core/src/main/java/org/apache/olingo/client/core/domain/ClientDeltaImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/domain/ClientDeltaImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/domain/ClientDeltaImpl.java
index 02af157..30f3356 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/domain/ClientDeltaImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/domain/ClientDeltaImpl.java
@@ -57,4 +57,55 @@ public class ClientDeltaImpl extends ClientEntitySetImpl implements ClientDelta
     return deletedLinks;
   }
 
+  @Override
+  public int hashCode() {
+    final int prime = 31;
+    int result = super.hashCode();
+    result = prime * result + ((addedLinks == null) ? 0 : addedLinks.hashCode());
+    result = prime * result + ((deletedEntities == null) ? 0 : deletedEntities.hashCode());
+    result = prime * result + ((deletedLinks == null) ? 0 : deletedLinks.hashCode());
+    return result;
+  }
+
+  @Override
+  public boolean equals(Object obj) {
+    if (this == obj) {
+      return true;
+    }
+    if (!super.equals(obj)) {
+      return false;
+    }
+    if (!(obj instanceof ClientDeltaImpl)) {
+      return false;
+    }
+    ClientDeltaImpl other = (ClientDeltaImpl) obj;
+    if (addedLinks == null) {
+      if (other.addedLinks != null) {
+        return false;
+      }
+    } else if (!addedLinks.equals(other.addedLinks)) {
+      return false;
+    }
+    if (deletedEntities == null) {
+      if (other.deletedEntities != null) {
+        return false;
+      }
+    } else if (!deletedEntities.equals(other.deletedEntities)) {
+      return false;
+    }
+    if (deletedLinks == null) {
+      if (other.deletedLinks != null) {
+        return false;
+      }
+    } else if (!deletedLinks.equals(other.deletedLinks)) {
+      return false;
+    }
+    return true;
+  }
+
+  @Override
+  public String toString() {
+    return "ClientDeltaImpl [deletedEntities=" + deletedEntities + ", addedLinks=" + addedLinks + ", deletedLinks="
+        + deletedLinks + "super[" + super.toString() + "]]";
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a1731b7e/lib/client-core/src/main/java/org/apache/olingo/client/core/domain/ClientDeltaLinkImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/domain/ClientDeltaLinkImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/domain/ClientDeltaLinkImpl.java
index 29a1572..0d8fd52 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/domain/ClientDeltaLinkImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/domain/ClientDeltaLinkImpl.java
@@ -75,4 +75,64 @@ public class ClientDeltaLinkImpl extends ClientItem implements ClientDeltaLink {
     return annotations;
   }
 
+  @Override
+  public int hashCode() {
+    final int prime = 31;
+    int result = super.hashCode();
+    result = prime * result + ((annotations == null) ? 0 : annotations.hashCode());
+    result = prime * result + ((relationship == null) ? 0 : relationship.hashCode());
+    result = prime * result + ((source == null) ? 0 : source.hashCode());
+    result = prime * result + ((target == null) ? 0 : target.hashCode());
+    return result;
+  }
+
+  @Override
+  public boolean equals(Object obj) {
+    if (this == obj) {
+      return true;
+    }
+    if (!super.equals(obj)) {
+      return false;
+    }
+    if (!(obj instanceof ClientDeltaLinkImpl)) {
+      return false;
+    }
+    ClientDeltaLinkImpl other = (ClientDeltaLinkImpl) obj;
+    if (annotations == null) {
+      if (other.annotations != null) {
+        return false;
+      }
+    } else if (!annotations.equals(other.annotations)) {
+      return false;
+    }
+    if (relationship == null) {
+      if (other.relationship != null) {
+        return false;
+      }
+    } else if (!relationship.equals(other.relationship)) {
+      return false;
+    }
+    if (source == null) {
+      if (other.source != null) {
+        return false;
+      }
+    } else if (!source.equals(other.source)) {
+      return false;
+    }
+    if (target == null) {
+      if (other.target != null) {
+        return false;
+      }
+    } else if (!target.equals(other.target)) {
+      return false;
+    }
+    return true;
+  }
+
+  @Override
+  public String toString() {
+    return "ClientDeltaLinkImpl [source=" + source + ", relationship=" + relationship + ", target=" + target
+        + ", annotations=" + annotations + "super[" + super.toString() + "]]";
+  }
+
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a1731b7e/lib/client-core/src/main/java/org/apache/olingo/client/core/domain/ClientEntityImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/domain/ClientEntityImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/domain/ClientEntityImpl.java
index 1c0d31b..4426e03 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/domain/ClientEntityImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/domain/ClientEntityImpl.java
@@ -295,4 +295,143 @@ public class ClientEntityImpl extends AbstractClientPayload implements ClientEnt
   public List<ClientAnnotation> getAnnotations() {
     return annotations;
   }
+
+  @Override
+  public int hashCode() {
+    final int prime = 31;
+    int result = super.hashCode();
+    result = prime * result + ((annotations == null) ? 0 : annotations.hashCode());
+    result = prime * result + ((associationLinks == null) ? 0 : associationLinks.hashCode());
+    result = prime * result + ((eTag == null) ? 0 : eTag.hashCode());
+    result = prime * result + ((editLink == null) ? 0 : editLink.hashCode());
+    result = prime * result + ((id == null) ? 0 : id.hashCode());
+    result = prime * result + ((mediaContentSource == null) ? 0 : mediaContentSource.hashCode());
+    result = prime * result + ((mediaContentType == null) ? 0 : mediaContentType.hashCode());
+    result = prime * result + ((mediaETag == null) ? 0 : mediaETag.hashCode());
+    result = prime * result + ((mediaEditLinks == null) ? 0 : mediaEditLinks.hashCode());
+    result = prime * result + (mediaEntity ? 1231 : 1237);
+    result = prime * result + ((navigationLinks == null) ? 0 : navigationLinks.hashCode());
+    result = prime * result + ((operations == null) ? 0 : operations.hashCode());
+    result = prime * result + ((properties == null) ? 0 : properties.hashCode());
+    result = prime * result + ((typeName == null) ? 0 : typeName.hashCode());
+    return result;
+  }
+
+  @Override
+  public boolean equals(Object obj) {
+    if (this == obj) {
+      return true;
+    }
+    if (!super.equals(obj)) {
+      return false;
+    }
+    if (!(obj instanceof ClientEntityImpl)) {
+      return false;
+    }
+    ClientEntityImpl other = (ClientEntityImpl) obj;
+    if (annotations == null) {
+      if (other.annotations != null) {
+        return false;
+      }
+    } else if (!annotations.equals(other.annotations)) {
+      return false;
+    }
+    if (associationLinks == null) {
+      if (other.associationLinks != null) {
+        return false;
+      }
+    } else if (!associationLinks.equals(other.associationLinks)) {
+      return false;
+    }
+    if (eTag == null) {
+      if (other.eTag != null) {
+        return false;
+      }
+    } else if (!eTag.equals(other.eTag)) {
+      return false;
+    }
+    if (editLink == null) {
+      if (other.editLink != null) {
+        return false;
+      }
+    } else if (!editLink.equals(other.editLink)) {
+      return false;
+    }
+    if (id == null) {
+      if (other.id != null) {
+        return false;
+      }
+    } else if (!id.equals(other.id)) {
+      return false;
+    }
+    if (mediaContentSource == null) {
+      if (other.mediaContentSource != null) {
+        return false;
+      }
+    } else if (!mediaContentSource.equals(other.mediaContentSource)) {
+      return false;
+    }
+    if (mediaContentType == null) {
+      if (other.mediaContentType != null) {
+        return false;
+      }
+    } else if (!mediaContentType.equals(other.mediaContentType)) {
+      return false;
+    }
+    if (mediaETag == null) {
+      if (other.mediaETag != null) {
+        return false;
+      }
+    } else if (!mediaETag.equals(other.mediaETag)) {
+      return false;
+    }
+    if (mediaEditLinks == null) {
+      if (other.mediaEditLinks != null) {
+        return false;
+      }
+    } else if (!mediaEditLinks.equals(other.mediaEditLinks)) {
+      return false;
+    }
+    if (mediaEntity != other.mediaEntity) {
+      return false;
+    }
+    if (navigationLinks == null) {
+      if (other.navigationLinks != null) {
+        return false;
+      }
+    } else if (!navigationLinks.equals(other.navigationLinks)) {
+      return false;
+    }
+    if (operations == null) {
+      if (other.operations != null) {
+        return false;
+      }
+    } else if (!operations.equals(other.operations)) {
+      return false;
+    }
+    if (properties == null) {
+      if (other.properties != null) {
+        return false;
+      }
+    } else if (!properties.equals(other.properties)) {
+      return false;
+    }
+    if (typeName == null) {
+      if (other.typeName != null) {
+        return false;
+      }
+    } else if (!typeName.equals(other.typeName)) {
+      return false;
+    }
+    return true;
+  }
+
+  @Override
+  public String toString() {
+    return "ClientEntityImpl [id=" + id + ", eTag=" + eTag + ", mediaEntity=" + mediaEntity + ", mediaContentType="
+        + mediaContentType + ", mediaContentSource=" + mediaContentSource + ", mediaETag=" + mediaETag + ", editLink="
+        + editLink + ", properties=" + properties + ", annotations=" + annotations + ", typeName=" + typeName
+        + ", navigationLinks=" + navigationLinks + ", associationLinks=" + associationLinks + ", mediaEditLinks="
+        + mediaEditLinks + ", operations=" + operations + "super[" + super.toString() + "]]";
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a1731b7e/lib/client-core/src/main/java/org/apache/olingo/client/core/domain/ClientEntitySetImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/domain/ClientEntitySetImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/domain/ClientEntitySetImpl.java
index 7d7e646..29ede4c 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/domain/ClientEntitySetImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/domain/ClientEntitySetImpl.java
@@ -62,4 +62,55 @@ public class ClientEntitySetImpl extends AbstractClientEntitySet implements Clie
     return annotations;
   }
 
+  @Override
+  public int hashCode() {
+    final int prime = 31;
+    int result = super.hashCode();
+    result = prime * result + ((annotations == null) ? 0 : annotations.hashCode());
+    result = prime * result + ((deltaLink == null) ? 0 : deltaLink.hashCode());
+    result = prime * result + ((entities == null) ? 0 : entities.hashCode());
+    return result;
+  }
+
+  @Override
+  public boolean equals(Object obj) {
+    if (this == obj) {
+      return true;
+    }
+    if (!super.equals(obj)) {
+      return false;
+    }
+    if (!(obj instanceof ClientEntitySetImpl)) {
+      return false;
+    }
+    ClientEntitySetImpl other = (ClientEntitySetImpl) obj;
+    if (annotations == null) {
+      if (other.annotations != null) {
+        return false;
+      }
+    } else if (!annotations.equals(other.annotations)) {
+      return false;
+    }
+    if (deltaLink == null) {
+      if (other.deltaLink != null) {
+        return false;
+      }
+    } else if (!deltaLink.equals(other.deltaLink)) {
+      return false;
+    }
+    if (entities == null) {
+      if (other.entities != null) {
+        return false;
+      }
+    } else if (!entities.equals(other.entities)) {
+      return false;
+    }
+    return true;
+  }
+
+  @Override
+  public String toString() {
+    return "ClientEntitySetImpl [deltaLink=" + deltaLink + ", entities=" + entities + ", annotations=" + annotations
+        + "super[" + super.toString() + "]]";
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a1731b7e/lib/client-core/src/main/java/org/apache/olingo/client/core/domain/ClientEnumValueImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/domain/ClientEnumValueImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/domain/ClientEnumValueImpl.java
index 84559c7..6cec564 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/domain/ClientEnumValueImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/domain/ClientEnumValueImpl.java
@@ -56,4 +56,33 @@ public class ClientEnumValueImpl extends AbstractClientValue implements ClientEn
 
   }
 
+  @Override
+  public int hashCode() {
+    final int prime = 31;
+    int result = super.hashCode();
+    result = prime * result + ((value == null) ? 0 : value.hashCode());
+    return result;
+  }
+
+  @Override
+  public boolean equals(Object obj) {
+    if (this == obj) {
+      return true;
+    }
+    if (!super.equals(obj)) {
+      return false;
+    }
+    if (!(obj instanceof ClientEnumValueImpl)) {
+      return false;
+    }
+    ClientEnumValueImpl other = (ClientEnumValueImpl) obj;
+    if (value == null) {
+      if (other.value != null) {
+        return false;
+      }
+    } else if (!value.equals(other.value)) {
+      return false;
+    }
+    return true;
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a1731b7e/lib/client-core/src/main/java/org/apache/olingo/client/core/domain/ClientPrimitiveValueImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/domain/ClientPrimitiveValueImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/domain/ClientPrimitiveValueImpl.java
index 1c18c02..cdfe623 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/domain/ClientPrimitiveValueImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/domain/ClientPrimitiveValueImpl.java
@@ -230,4 +230,46 @@ public class ClientPrimitiveValueImpl extends AbstractClientValue implements Cli
     return false;
   }
 
+  @Override
+  public int hashCode() {
+    final int prime = 31;
+    int result = super.hashCode();
+    result = prime * result + ((type == null) ? 0 : type.hashCode());
+    result = prime * result + ((typeKind == null) ? 0 : typeKind.hashCode());
+    result = prime * result + ((value == null) ? 0 : value.hashCode());
+    return result;
+  }
+
+  @Override
+  public boolean equals(Object obj) {
+    if (this == obj) {
+      return true;
+    }
+    if (!super.equals(obj)) {
+      return false;
+    }
+    if (!(obj instanceof ClientPrimitiveValueImpl)) {
+      return false;
+    }
+    ClientPrimitiveValueImpl other = (ClientPrimitiveValueImpl) obj;
+    if (type == null) {
+      if (other.type != null) {
+        return false;
+      }
+    } else if (!type.equals(other.type)) {
+      return false;
+    }
+    if (typeKind != other.typeKind) {
+      return false;
+    }
+    if (value == null) {
+      if (other.value != null) {
+        return false;
+      }
+    } else if (!value.equals(other.value)) {
+      return false;
+    }
+    return true;
+  }
+
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a1731b7e/lib/client-core/src/main/java/org/apache/olingo/client/core/domain/ClientPropertyImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/domain/ClientPropertyImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/domain/ClientPropertyImpl.java
index eed965f..f78c506 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/domain/ClientPropertyImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/domain/ClientPropertyImpl.java
@@ -33,7 +33,6 @@ import java.util.List;
 
 public final class ClientPropertyImpl implements ClientProperty, ClientAnnotatable, ClientValuable {
 
-
   private final List<ClientAnnotation> annotations = new ArrayList<ClientAnnotation>();
   private final String name;
   private final ClientValue value;
@@ -116,35 +115,56 @@ public final class ClientPropertyImpl implements ClientProperty, ClientAnnotatab
   }
 
   @Override
-  public boolean equals(Object o) {
-    if (this == o) {
+  public boolean equals(Object obj) {
+    if (this == obj) {
       return true;
     }
-    if (o == null || getClass() != o.getClass()) {
+    if (obj == null) {
       return false;
     }
-
-    ClientPropertyImpl that = (ClientPropertyImpl) o;
-
-    if (annotations != null ? !annotations.equals(that.annotations) : that.annotations != null) {
+    if (!(obj instanceof ClientPropertyImpl)) {
       return false;
     }
-    if (name != null ? !name.equals(that.name) : that.name != null) {
+    ClientPropertyImpl other = (ClientPropertyImpl) obj;
+    if (annotations == null) {
+      if (other.annotations != null) {
+        return false;
+      }
+    } else if (!annotations.equals(other.annotations)) {
       return false;
     }
-    if (value != null ? !value.equals(that.value) : that.value != null) {
+    if (name == null) {
+      if (other.name != null) {
+        return false;
+      }
+    } else if (!name.equals(other.name)) {
       return false;
     }
-    return !(valuable != null ? !valuable.equals(that.valuable) : that.valuable != null);
-
+    if (valuable == null) {
+      if (other.valuable != null) {
+        return false;
+      }
+    } else if (!valuable.equals(other.valuable)) {
+      return false;
+    }
+    if (value == null) {
+      if (other.value != null) {
+        return false;
+      }
+    } else if (!value.equals(other.value)) {
+      return false;
+    }
+    return true;
   }
 
   @Override
   public int hashCode() {
-    int result = annotations != null ? annotations.hashCode() : 0;
-    result = 31 * result + (name != null ? name.hashCode() : 0);
-    result = 31 * result + (value != null ? value.hashCode() : 0);
-    result = 31 * result + (valuable != null ? valuable.hashCode() : 0);
+    final int prime = 31;
+    int result = 1;
+    result = prime * result + ((annotations == null) ? 0 : annotations.hashCode());
+    result = prime * result + ((name == null) ? 0 : name.hashCode());
+    result = prime * result + ((valuable == null) ? 0 : valuable.hashCode());
+    result = prime * result + ((value == null) ? 0 : value.hashCode());
     return result;
   }