mirror of https://github.com/apache/jclouds.git
add clone checks
This commit is contained in:
parent
a307c44a22
commit
ed6cfca0a7
|
@ -199,6 +199,18 @@ public abstract class EntityType<T extends EntityType<T>> extends ResourceType<T
|
||||||
equal(this.tasksInProgress, that.tasksInProgress) && equal(this.name, that.name);
|
equal(this.tasksInProgress, that.tasksInProgress) && equal(this.name, that.name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean clone(Object o) {
|
||||||
|
if (this == o)
|
||||||
|
return false;
|
||||||
|
if (o == null || getClass() != o.getClass())
|
||||||
|
return false;
|
||||||
|
EntityType<?> that = EntityType.class.cast(o);
|
||||||
|
return super.equals(that) &&
|
||||||
|
equal(this.description, that.description) &&
|
||||||
|
equal(this.name, that.name);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return super.hashCode() + Objects.hashCode(description, tasksInProgress, id, name);
|
return super.hashCode() + Objects.hashCode(description, tasksInProgress, id, name);
|
||||||
|
|
|
@ -245,6 +245,17 @@ public class Media extends ResourceEntityType<Media> {
|
||||||
equal(this.owner, that.owner) && equal(this.imageType, that.imageType) && equal(this.size, that.size);
|
equal(this.owner, that.owner) && equal(this.imageType, that.imageType) && equal(this.size, that.size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean clone(Object o) {
|
||||||
|
if (this == o)
|
||||||
|
return false;
|
||||||
|
if (o == null || getClass() != o.getClass())
|
||||||
|
return false;
|
||||||
|
Media that = Media.class.cast(o);
|
||||||
|
return super.clone(that) &&
|
||||||
|
equal(this.owner, that.owner) && equal(this.imageType, that.imageType) && equal(this.size, that.size);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return super.hashCode() + Objects.hashCode(owner, imageType, size);
|
return super.hashCode() + Objects.hashCode(owner, imageType, size);
|
||||||
|
|
|
@ -168,6 +168,16 @@ public abstract class ResourceEntityType<T extends ResourceEntityType<T>> extend
|
||||||
return super.equals(that) && equal(this.files, that.files) && equal(this.status, that.status);
|
return super.equals(that) && equal(this.files, that.files) && equal(this.status, that.status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean clone(Object o) {
|
||||||
|
if (this == o)
|
||||||
|
return false;
|
||||||
|
if (o == null || getClass() != o.getClass())
|
||||||
|
return false;
|
||||||
|
ResourceEntityType<?> that = ResourceEntityType.class.cast(o);
|
||||||
|
return super.clone(that) && equal(this.files, that.files);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return super.hashCode() + Objects.hashCode(files, status);
|
return super.hashCode() + Objects.hashCode(files, status);
|
||||||
|
|
|
@ -161,6 +161,15 @@ public abstract class ResourceType<T extends ResourceType<T>> implements URISupp
|
||||||
return equal(this.href, that.href) && equal(this.links, that.links) && equal(this.type, that.type);
|
return equal(this.href, that.href) && equal(this.links, that.links) && equal(this.type, that.type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean clone(Object o) {
|
||||||
|
if (this == o)
|
||||||
|
return false;
|
||||||
|
if (o == null || getClass() != o.getClass())
|
||||||
|
return false;
|
||||||
|
ResourceType<?> that = ResourceType.class.cast(o);
|
||||||
|
return equal(this.type, that.type);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hashCode(href, links, type);
|
return Objects.hashCode(href, links, type);
|
||||||
|
|
Loading…
Reference in New Issue