WIP: updated static builders

This commit is contained in:
Claudio Atzori 2024-03-04 16:28:37 +01:00
parent da06e17041
commit 890c039a91
5 changed files with 13 additions and 6 deletions

View File

@ -12,6 +12,13 @@ public class AccessRight {
private OpenAccessRoute openAccessRoute;
public static AccessRight newInstance(String value, OpenAccessRoute openAccessRoute) {
AccessRight accessRight = new AccessRight();
accessRight.setValue(value);
accessRight.setOpenAccessRoute(openAccessRoute);
return accessRight;
}
public String getValue() {
return value;
}

View File

@ -9,7 +9,7 @@ public class Category implements Serializable {
private String label;
private List<Concept> concept;
public Category newInstance(String id, String label) {
public static Category newInstance(String id, String label) {
Category category = new Category();
category.setId(id);
category.setLabel(label);

View File

@ -7,7 +7,7 @@ public class Concept implements Serializable {
private String id;
private String label;
public Concept newInstance(String id, String label) {
public static Concept newInstance(String id, String label) {
Concept concept = new Concept();
concept.setId(id);
concept.setLabel(label);

View File

@ -10,7 +10,7 @@ public class Context implements Serializable {
private String type;
private List<Category> category;
public Context newInstance(String id, String label, String type, List<Category> category) {
public static Context newInstance(String id, String label, String type, List<Category> category) {
Context context = new Context();
context.setId(id);
context.setLabel(label);

View File

@ -9,15 +9,15 @@ public class Funding implements Serializable {
private FundingLevel level1;
private FundingLevel level2;
public Funding newInstance(Funder funder, FundingLevel level0) {
public static Funding newInstance(Funder funder, FundingLevel level0) {
return newInstance(funder, level0, null, null);
}
public Funding newInstance(Funder funder, FundingLevel level0, FundingLevel level1) {
public static Funding newInstance(Funder funder, FundingLevel level0, FundingLevel level1) {
return newInstance(funder, level0, level1, null);
}
public Funding newInstance(Funder funder, FundingLevel level0, FundingLevel level1, FundingLevel level2) {
public static Funding newInstance(Funder funder, FundingLevel level0, FundingLevel level1, FundingLevel level2) {
Funding funding = new Funding();
funding.setFunder(funder);
funding.setLevel0(level0);