X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ecomp-portal-BE-common%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fportalapp%2Fportal%2Ftransport%2FCentralRole.java;h=6f587697386e563a91bc11c7f74ade8ec1d7080a;hb=8dc7c79b05b1059392974055628dec0463616002;hp=53f7700ed91a673475befc8c3b72c96ff499d4b5;hpb=c97fca88eab7acc8a6b4bbfc469d7478f03f3112;p=portal.git diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/CentralRole.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/CentralRole.java index 53f7700e..6f587697 100644 --- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/CentralRole.java +++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/CentralRole.java @@ -78,24 +78,99 @@ public class CentralRole implements Serializable { this.roleFunctions = roleFunctions; } - + public static class CentralRoleBuilder { + private Long id; + private String name; + private boolean active; + private Integer priority; + private SortedSet roleFunctions; + private Date created; + private Date modified; + private Long createdId; + private Long modifiedId; + private Long rowNum; + private SortedSet childRoles; + private SortedSet parentRoles; + + public CentralRoleBuilder setId(Long id) { + this.id = id; + return this; + } + + public CentralRoleBuilder setName(String name) { + this.name = name; + return this; + } + + public CentralRoleBuilder setActive(boolean active) { + this.active = active; + return this; + } + + public CentralRoleBuilder setPriority(Integer priority) { + this.priority = priority; + return this; + } + + public CentralRoleBuilder setRoleFunctions(SortedSet roleFunctions) { + this.roleFunctions = roleFunctions; + return this; + } + + public CentralRoleBuilder setCreated(Date created) { + this.created = created; + return this; + } + + public CentralRoleBuilder setModified(Date modified) { + this.modified = modified; + return this; + } + + public CentralRoleBuilder setCreatedId(Long createdId) { + this.createdId = createdId; + return this; + } + + public CentralRoleBuilder setModifiedId(Long modifiedId) { + this.modifiedId = modifiedId; + return this; + } + + public CentralRoleBuilder setRowNum(Long rowNum) { + this.rowNum = rowNum; + return this; + } + + public CentralRoleBuilder setChildRoles(SortedSet childRoles) { + this.childRoles = childRoles; + return this; + } + + public CentralRoleBuilder setParentRoles(SortedSet parentRoles) { + this.parentRoles = parentRoles; + return this; + } + + public CentralRole createCentralRole() { + return new CentralRole(this); + } + } - public CentralRole(Long id, Date created, Date modified, Long createdId, Long modifiedId, Long rowNum, String name, - boolean active, Integer priority, SortedSet roleFunctions, - SortedSet childRoles, SortedSet parentRoles) { + public CentralRole(CentralRoleBuilder centralRoleBuilder) { super(); - this.id = id; - this.created = created; - this.modified = modified; - this.createdId = createdId; - this.modifiedId = modifiedId; - this.rowNum = rowNum; - this.name = name; - this.active = active; - this.priority = priority; - this.roleFunctions = roleFunctions; - this.childRoles = childRoles; - this.parentRoles = parentRoles; + this.id = centralRoleBuilder.id; + this.created = centralRoleBuilder.created; + this.modified = centralRoleBuilder.modified; + this.createdId = centralRoleBuilder.createdId; + this.modifiedId = centralRoleBuilder.modifiedId; + this.rowNum = centralRoleBuilder.rowNum; + this.name = centralRoleBuilder.name; + this.active = centralRoleBuilder.active; + this.priority = centralRoleBuilder.priority; + this.roleFunctions = centralRoleBuilder.roleFunctions; + this.childRoles = centralRoleBuilder.childRoles; + this.parentRoles = centralRoleBuilder.parentRoles; } /**