[Minor] Code cleanup
This commit is contained in:
parent
3cce0a7e9a
commit
4aec95eb93
|
@ -142,15 +142,10 @@ public abstract class AbstractStrolchElement implements StrolchElement {
|
|||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
}
|
||||
if (obj == null) {
|
||||
if (obj == null || getClass() != obj.getClass())
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
AbstractStrolchElement other = (AbstractStrolchElement) obj;
|
||||
if (this.id == null) {
|
||||
return other.id == null;
|
||||
|
|
|
@ -292,6 +292,16 @@ public class Order extends AbstractStrolchRootElement implements StrolchRootElem
|
|||
return visitor.visitOrder(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null || getClass() != obj.getClass())
|
||||
return false;
|
||||
Order o = (Order) obj;
|
||||
return this.type.equals(o.type) && this.id.equals(o.id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
|
||||
|
|
|
@ -380,6 +380,16 @@ public class Resource extends AbstractStrolchRootElement implements StrolchRootE
|
|||
return visitor.visitResource(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null || getClass() != obj.getClass())
|
||||
return false;
|
||||
Resource r = (Resource) obj;
|
||||
return this.type.equals(r.type) && this.id.equals(r.id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
|
||||
|
|
|
@ -766,6 +766,16 @@ public class Activity extends AbstractStrolchRootElement
|
|||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null || getClass() != obj.getClass())
|
||||
return false;
|
||||
Activity a = (Activity) obj;
|
||||
return this.parent == a.parent && this.type.equals(a.type) && this.id.equals(a.id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
final StringBuilder builder = new StringBuilder();
|
||||
|
|
Loading…
Reference in New Issue