2020-04-27 14:52:31 +02:00
|
|
|
|
2020-03-27 10:42:17 +01:00
|
|
|
package eu.dnetlib.dhp.oa.provision.model;
|
2020-01-16 11:02:28 +01:00
|
|
|
|
|
|
|
import java.io.Serializable;
|
|
|
|
|
2020-04-28 11:23:29 +02:00
|
|
|
import com.google.common.base.Objects;
|
|
|
|
|
2020-06-24 18:34:42 +02:00
|
|
|
import eu.dnetlib.dhp.schema.oaf.Relation;
|
|
|
|
|
2020-06-01 00:32:42 +02:00
|
|
|
public class RelatedEntityWrapper implements Serializable {
|
2020-01-30 17:46:29 +01:00
|
|
|
|
2020-06-24 18:34:42 +02:00
|
|
|
private Relation relation;
|
2020-04-27 14:52:31 +02:00
|
|
|
private RelatedEntity target;
|
|
|
|
|
2020-06-01 00:32:42 +02:00
|
|
|
public RelatedEntityWrapper() {
|
2020-04-27 14:52:31 +02:00
|
|
|
}
|
|
|
|
|
2020-06-24 18:34:42 +02:00
|
|
|
public RelatedEntityWrapper(Relation relation, RelatedEntity target) {
|
2020-04-27 14:52:31 +02:00
|
|
|
this.relation = relation;
|
|
|
|
this.target = target;
|
|
|
|
}
|
|
|
|
|
2020-06-24 18:34:42 +02:00
|
|
|
public Relation getRelation() {
|
2020-04-27 14:52:31 +02:00
|
|
|
return relation;
|
|
|
|
}
|
|
|
|
|
2020-06-24 18:34:42 +02:00
|
|
|
public void setRelation(Relation relation) {
|
2020-04-27 14:52:31 +02:00
|
|
|
this.relation = relation;
|
|
|
|
}
|
|
|
|
|
|
|
|
public RelatedEntity getTarget() {
|
|
|
|
return target;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setTarget(RelatedEntity target) {
|
|
|
|
this.target = target;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean equals(Object o) {
|
|
|
|
if (this == o)
|
|
|
|
return true;
|
|
|
|
if (o == null || getClass() != o.getClass())
|
|
|
|
return false;
|
2020-06-01 00:32:42 +02:00
|
|
|
RelatedEntityWrapper that = (RelatedEntityWrapper) o;
|
|
|
|
return Objects.equal(relation, that.relation)
|
2020-04-27 14:52:31 +02:00
|
|
|
&& Objects.equal(target, that.target);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int hashCode() {
|
2020-06-01 00:32:42 +02:00
|
|
|
return Objects.hashCode(relation, target);
|
2020-04-27 14:52:31 +02:00
|
|
|
}
|
2020-01-16 11:02:28 +01:00
|
|
|
}
|