mirror of
https://github.com/apache/jclouds.git
synced 2025-03-01 05:49:06 +00:00
Add missing equals and hashCode methods
Possible cause of odd PageSet behavior.
This commit is contained in:
parent
d5357f76e8
commit
7e6284dd86
@ -22,6 +22,7 @@ import java.net.URI;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
import com.google.common.base.Objects;
|
||||
import org.jclouds.blobstore.domain.BlobMetadata;
|
||||
import org.jclouds.blobstore.domain.StorageType;
|
||||
import org.jclouds.domain.Location;
|
||||
@ -71,4 +72,23 @@ public class BlobMetadataImpl extends StorageMetadataImpl implements BlobMetadat
|
||||
return contentMetadata;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object object) {
|
||||
if (object == this) {
|
||||
return true;
|
||||
}
|
||||
if (!(object instanceof BlobMetadataImpl)) {
|
||||
return false;
|
||||
}
|
||||
BlobMetadataImpl that = (BlobMetadataImpl) object;
|
||||
return super.equals(that) &&
|
||||
Objects.equal(publicUri, that.publicUri) &&
|
||||
Objects.equal(container, that.container) &&
|
||||
Objects.equal(contentMetadata, that.contentMetadata);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hashCode(super.hashCode(), publicUri, container, contentMetadata);
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,7 @@ package org.jclouds.blobstore.domain.internal;
|
||||
|
||||
import java.net.URI;
|
||||
|
||||
import com.google.common.base.Objects;
|
||||
import org.jclouds.blobstore.domain.BlobMetadata;
|
||||
import org.jclouds.blobstore.domain.MutableBlobMetadata;
|
||||
import org.jclouds.blobstore.domain.StorageType;
|
||||
@ -95,4 +96,23 @@ public class MutableBlobMetadataImpl extends MutableStorageMetadataImpl implemen
|
||||
this.container = container;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object object) {
|
||||
if (object == this) {
|
||||
return true;
|
||||
}
|
||||
if (!(object instanceof MutableBlobMetadataImpl)) {
|
||||
return false;
|
||||
}
|
||||
MutableBlobMetadataImpl that = (MutableBlobMetadataImpl) object;
|
||||
return super.equals(that) &&
|
||||
Objects.equal(contentMetadata, that.contentMetadata) &&
|
||||
Objects.equal(publicUri, that.publicUri) &&
|
||||
Objects.equal(container, that.container);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hashCode(super.hashCode(), contentMetadata, publicUri, container);
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,7 @@ package org.jclouds.blobstore.domain.internal;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.google.common.base.Objects;
|
||||
import org.jclouds.blobstore.domain.MutableStorageMetadata;
|
||||
import org.jclouds.blobstore.domain.StorageMetadata;
|
||||
import org.jclouds.blobstore.domain.StorageType;
|
||||
@ -96,4 +97,25 @@ public class MutableStorageMetadataImpl extends MutableResourceMetadataImpl<Stor
|
||||
public void setSize(Long size) {
|
||||
this.size = size;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object object) {
|
||||
if (object == this) {
|
||||
return true;
|
||||
}
|
||||
if (!(object instanceof MutableStorageMetadataImpl)) {
|
||||
return false;
|
||||
}
|
||||
MutableStorageMetadataImpl that = (MutableStorageMetadataImpl) object;
|
||||
return super.equals(that) &&
|
||||
Objects.equal(eTag, that.eTag) &&
|
||||
Objects.equal(creationDate, that.creationDate) &&
|
||||
Objects.equal(lastModified, that.lastModified) &&
|
||||
Objects.equal(size, that.size);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hashCode(super.hashCode(), eTag, creationDate, lastModified, size);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user