- if (role.getAppRoleId() == null) {
- cenRole = new CentralV2Role(role.getId(), role.getCreated(), role.getModified(), role.getCreatedId(),
- role.getModifiedId(), role.getRowNum(), role.getName(), role.getActive(), role.getPriority(),
- roleFunctionSet, childRoles, parentRoles);
- } else {
- cenRole = new CentralV2Role(role.getAppRoleId(), role.getCreated(), role.getModified(),
- role.getCreatedId(), role.getModifiedId(), role.getRowNum(), role.getName(), role.getActive(),
- role.getPriority(), roleFunctionSet, childRoles, parentRoles);
- }
+ if (role.getAppRoleId() == null) {
+ cenRole = new CentralV2Role.CentralV2RoleBuilder().setId(role.getId()).setCreated(role.getCreated())
+ .setModified(role.getModified()).setCreatedId(role.getCreatedId())
+ .setModifiedId(role.getModifiedId()).setRowNum(role.getRowNum()).setName(role.getName())
+ .setActive(role.getActive()).setPriority(role.getPriority()).setRoleFunctions(roleFunctionSet)
+ .setChildRoles(childRoles).setParentRoles(parentRoles).createCentralV2Role();
+ } else {
+ cenRole = new CentralV2Role.CentralV2RoleBuilder().setId(role.getAppRoleId())
+ .setCreated(role.getCreated()).setModified(role.getModified()).setCreatedId(role.getCreatedId())
+ .setModifiedId(role.getModifiedId()).setRowNum(role.getRowNum()).setName(role.getName())
+ .setActive(role.getActive()).setPriority(role.getPriority()).setRoleFunctions(roleFunctionSet)
+ .setChildRoles(childRoles).setParentRoles(parentRoles).createCentralV2Role();
+ }