45 lines
1.1 KiB
Java
45 lines
1.1 KiB
Java
|
package eu.eudat.models.data.rda;
|
||
|
|
||
|
import eu.eudat.data.entities.Funder;
|
||
|
import eu.eudat.data.entities.Grant;
|
||
|
|
||
|
public class FundingRDAExportModel {
|
||
|
private FunderIdRDAExportModel funder_id;
|
||
|
private GrantIdRDAExportModel grant_id;
|
||
|
private String funding_status;
|
||
|
|
||
|
public FunderIdRDAExportModel getFunder_id() {
|
||
|
return funder_id;
|
||
|
}
|
||
|
public void setFunder_id(FunderIdRDAExportModel funder_id) {
|
||
|
this.funder_id = funder_id;
|
||
|
}
|
||
|
|
||
|
public GrantIdRDAExportModel getGrant_id() {
|
||
|
return grant_id;
|
||
|
}
|
||
|
public void setGrant_id(GrantIdRDAExportModel grant_id) {
|
||
|
this.grant_id = grant_id;
|
||
|
}
|
||
|
|
||
|
public String getFunding_status() {
|
||
|
return funding_status;
|
||
|
}
|
||
|
public void setFunding_status(String funding_status) {
|
||
|
this.funding_status = funding_status;
|
||
|
}
|
||
|
|
||
|
public FundingRDAExportModel fromDataModel(Funder funder, Grant grant) {
|
||
|
this.funding_status = "planned"; // mock data
|
||
|
if (funder != null) {
|
||
|
this.funder_id = new FunderIdRDAExportModel();
|
||
|
this.funder_id.setFunder_id(funder.getReference());
|
||
|
}
|
||
|
if (grant != null) {
|
||
|
this.grant_id = new GrantIdRDAExportModel();
|
||
|
this.grant_id.setGrant_id(grant.getReference());
|
||
|
}
|
||
|
return this;
|
||
|
}
|
||
|
}
|