2020-01-16 11:02:28 +01:00
|
|
|
package eu.dnetlib.dhp.graph;
|
|
|
|
|
|
|
|
import java.io.Serializable;
|
|
|
|
|
|
|
|
public class EntityRelEntity implements Serializable {
|
|
|
|
private TypedRow source;
|
2020-01-21 16:35:44 +01:00
|
|
|
private TypedRow relation;
|
2020-01-16 11:02:28 +01:00
|
|
|
private TypedRow target;
|
|
|
|
|
2020-01-21 16:35:44 +01:00
|
|
|
public EntityRelEntity() {
|
|
|
|
}
|
|
|
|
|
2020-01-16 11:02:28 +01:00
|
|
|
public EntityRelEntity(TypedRow source) {
|
|
|
|
this.source = source;
|
|
|
|
}
|
|
|
|
|
2020-01-21 16:35:44 +01:00
|
|
|
|
|
|
|
//helpers
|
|
|
|
public Boolean hasMainEntity() {
|
|
|
|
return getSource() != null & getRelation() == null & getTarget() == null;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Boolean hasRelatedEntity() {
|
|
|
|
return getSource() == null & getRelation() != null & getTarget() != null;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-01-16 11:02:28 +01:00
|
|
|
public TypedRow getSource() {
|
|
|
|
return source;
|
|
|
|
}
|
|
|
|
|
|
|
|
public EntityRelEntity setSource(TypedRow source) {
|
|
|
|
this.source = source;
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
2020-01-21 16:35:44 +01:00
|
|
|
public TypedRow getRelation() {
|
2020-01-16 11:02:28 +01:00
|
|
|
return relation;
|
|
|
|
}
|
|
|
|
|
2020-01-21 16:35:44 +01:00
|
|
|
public EntityRelEntity setRelation(TypedRow relation) {
|
2020-01-16 11:02:28 +01:00
|
|
|
this.relation = relation;
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public TypedRow getTarget() {
|
|
|
|
return target;
|
|
|
|
}
|
|
|
|
|
|
|
|
public EntityRelEntity setTarget(TypedRow target) {
|
|
|
|
this.target = target;
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
}
|