package eu.dnetlib.dli;

import java.io.Serializable;
import java.util.List;


class Relation implements Serializable, Comparable<Relation> {
    private String pid;
    private String pidType;
    private String relationType;
    private String targetType;
    private String inverseRelationType;

    public Relation() {

    }

    public Relation(String pid, String pidType, String relationType, String inverseRelationType, String targetType) {
        this.pid = pid;
        this.pidType = pidType;
        this.relationType = relationType;
        this.inverseRelationType = inverseRelationType;
        this.targetType = targetType;
    }

    public String getPid() {
        return pid;
    }

    public void setPid(String pid) {
        this.pid = pid;
    }

    public String getPidType() {
        return pidType;
    }

    public void setPidType(String pidType) {
        this.pidType = pidType;
    }

    public String getRelationType() {
        return relationType;
    }

    public void setRelationType(String relationType) {
        this.relationType = relationType;
    }

    public String getInverseRelationType() {
        return inverseRelationType;
    }

    public void setInverseRelationType(String inverseRelationType) {
        this.inverseRelationType = inverseRelationType;
    }

    public String getTargetType() {
        return targetType;
    }

    public void setTargetType(String targetType) {
        this.targetType = targetType;
    }

    @Override
    public int compareTo(Relation o) {
        if (pid.equals(o.getPid()) && pidType.equals(o.getPidType()) && relationType.equals(o.getRelationType()))
            return 0;
        return  1;
    }
}

public class ResultObject implements Serializable {

    private List<Relation> rels;
    private String body;

    public ResultObject(List<Relation> rels, String body) {
        this.rels = rels;
        this.body = body;
    }

    public String getBody() {
        return body;
    }

    public void setBody(String body) {
        this.body = body;
    }


    public List<Relation> getRels() {
        return rels;
    }

    public void setRels(List<Relation> rels) {
        this.rels = rels;
    }
}
