From 5003f7adb3a7126aafc0ed80b46fbf852051a1e9 Mon Sep 17 00:00:00 2001 From: danikov Date: Wed, 29 Feb 2012 11:30:51 +0000 Subject: [PATCH] fix toString, equals and hashcode, --- .../jclouds/vcloud/director/v1_5/domain/File.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/File.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/File.java index b9e455dcb0..47b0015cdd 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/File.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/File.java @@ -31,6 +31,7 @@ import javax.xml.bind.annotation.adapters.NormalizedStringAdapter; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import com.google.common.base.Objects; +import com.google.common.base.Objects.ToStringHelper; import com.google.common.collect.Sets; @@ -228,24 +229,26 @@ public class File extends EntityType { if (o == null || getClass() != o.getClass()) return false; File that = File.class.cast(o); - return equal(size, that.size) && + return super.equals(that) && + equal(size, that.size) && equal(bytesTransferred, that.bytesTransferred) && equal(checksum, that.checksum); } @Override public int hashCode() { - return Objects.hashCode(size, + return Objects.hashCode(super.hashCode(), + size, bytesTransferred, checksum); } @Override - public String toString() { - return Objects.toStringHelper("") + public ToStringHelper string() { + return super.string() .add("size", size) .add("bytesTransferred", bytesTransferred) - .add("checksum", checksum).toString(); + .add("checksum", checksum); } }