@Test public void test_to_contract() { final BudgetDetailContract expectedContract = budgetDetailMapper.toContract(domain()); assertEquals(expectedContract.getId(), contract().getId()); assertEquals(expectedContract.getBudgetGroup().getId(), contract().getBudgetGroup().getId()); assertEquals(expectedContract.getBudget().getId(), contract().getBudget().getId()); assertEquals(expectedContract.getOriginalAmount(), contract().getOriginalAmount()); assertEquals(expectedContract.getApprovedAmount(), contract().getApprovedAmount()); assertEquals(expectedContract.getBudgetAvailable(), contract().getBudgetAvailable()); assertEquals(expectedContract.getAnticipatoryAmount(), contract().getAnticipatoryAmount()); assertEquals(expectedContract.getUsingDepartment().getId(), contract().getUsingDepartment().getId()); assertEquals(expectedContract.getExecutingDepartment().getId(), contract().getExecutingDepartment().getId()); assertEquals(expectedContract.getFunction().getId(), contract().getFunction().getId()); assertEquals(expectedContract.getScheme().getId(), contract().getScheme().getId()); assertEquals(expectedContract.getFund().getId(), contract().getFund().getId()); assertEquals(expectedContract.getSubScheme().getId(), contract().getSubScheme().getId()); assertEquals(expectedContract.getFunctionary().getId(), contract().getFunctionary().getId()); assertEquals(expectedContract.getBoundary().getId(), contract().getBoundary().getId()); assertEquals(expectedContract.getMaterializedPath(), contract().getMaterializedPath()); assertEquals(expectedContract.getDocumentNumber(), contract().getDocumentNumber()); assertEquals(expectedContract.getUniqueNo(), contract().getUniqueNo()); assertEquals(expectedContract.getPlanningPercent(), contract().getPlanningPercent()); assertEquals(expectedContract.getStatus().getId(), contract().getStatus().getId()); assertEquals(expectedContract.getCreatedBy().getId(), contract().getCreatedBy().getId()); assertEquals(expectedContract.getLastModifiedBy().getId(), contract().getLastModifiedBy().getId()); assertEquals(expectedContract.getTenantId(), contract().getTenantId()); }
public BudgetDetailContract toContract(final BudgetDetail budgetDetail) { final BudgetDetailContract contract = new BudgetDetailContract(); contract.setId(budgetDetail.getId()); contract.setBudgetGroup(budgetDetail.getBudgetGroup() != null ? budgetDetail.getBudgetGroup() : null); if (budgetDetail.getBudget() != null) { final BudgetMapper bMapper = new BudgetMapper(); contract.setBudget(bMapper.toContract(budgetDetail.getBudget())); } contract.setOriginalAmount(budgetDetail.getOriginalAmount()); contract.setApprovedAmount(budgetDetail.getApprovedAmount()); contract.setBudgetAvailable(budgetDetail.getBudgetAvailable()); contract.setAnticipatoryAmount(budgetDetail.getAnticipatoryAmount()); contract.setUsingDepartment(budgetDetail.getUsingDepartment()); contract.setExecutingDepartment(budgetDetail.getExecutingDepartment()); contract.setFunction(budgetDetail.getFunction()); contract.setScheme(budgetDetail.getScheme()); contract.setFund(budgetDetail.getFund()); contract.setSubScheme(budgetDetail.getSubScheme()); contract.setFunctionary(budgetDetail.getFunctionary()); contract.setBoundary(budgetDetail.getBoundary()); contract.setMaterializedPath(budgetDetail.getMaterializedPath()); contract.setDocumentNumber(budgetDetail.getDocumentNumber()); contract.setUniqueNo(budgetDetail.getUniqueNo()); contract.setPlanningPercent(budgetDetail.getPlanningPercent()); contract.setStatus(FinancialStatusContract.builder() .id(budgetDetail.getStatus() != null ? budgetDetail.getStatus().getId() : null).build()); contract.setCreatedBy(budgetDetail.getCreatedBy()); contract.setCreatedDate(budgetDetail.getCreatedDate()); contract.setLastModifiedBy(budgetDetail.getLastModifiedBy()); contract.setLastModifiedDate(budgetDetail.getLastModifiedDate()); contract.setTenantId(budgetDetail.getTenantId()); return contract; }
BudgetDetailMapper { public BudgetDetailContract toContract(final BudgetDetail budgetDetail) { final BudgetDetailContract contract = new BudgetDetailContract(); contract.setId(budgetDetail.getId()); contract.setBudgetGroup(budgetDetail.getBudgetGroup() != null ? budgetDetail.getBudgetGroup() : null); if (budgetDetail.getBudget() != null) { final BudgetMapper bMapper = new BudgetMapper(); contract.setBudget(bMapper.toContract(budgetDetail.getBudget())); } contract.setOriginalAmount(budgetDetail.getOriginalAmount()); contract.setApprovedAmount(budgetDetail.getApprovedAmount()); contract.setBudgetAvailable(budgetDetail.getBudgetAvailable()); contract.setAnticipatoryAmount(budgetDetail.getAnticipatoryAmount()); contract.setUsingDepartment(budgetDetail.getUsingDepartment()); contract.setExecutingDepartment(budgetDetail.getExecutingDepartment()); contract.setFunction(budgetDetail.getFunction()); contract.setScheme(budgetDetail.getScheme()); contract.setFund(budgetDetail.getFund()); contract.setSubScheme(budgetDetail.getSubScheme()); contract.setFunctionary(budgetDetail.getFunctionary()); contract.setBoundary(budgetDetail.getBoundary()); contract.setMaterializedPath(budgetDetail.getMaterializedPath()); contract.setDocumentNumber(budgetDetail.getDocumentNumber()); contract.setUniqueNo(budgetDetail.getUniqueNo()); contract.setPlanningPercent(budgetDetail.getPlanningPercent()); contract.setStatus(FinancialStatusContract.builder() .id(budgetDetail.getStatus() != null ? budgetDetail.getStatus().getId() : null).build()); contract.setCreatedBy(budgetDetail.getCreatedBy()); contract.setCreatedDate(budgetDetail.getCreatedDate()); contract.setLastModifiedBy(budgetDetail.getLastModifiedBy()); contract.setLastModifiedDate(budgetDetail.getLastModifiedDate()); contract.setTenantId(budgetDetail.getTenantId()); return contract; } }
BudgetDetailMapper { public BudgetDetailContract toContract(final BudgetDetail budgetDetail) { final BudgetDetailContract contract = new BudgetDetailContract(); contract.setId(budgetDetail.getId()); contract.setBudgetGroup(budgetDetail.getBudgetGroup() != null ? budgetDetail.getBudgetGroup() : null); if (budgetDetail.getBudget() != null) { final BudgetMapper bMapper = new BudgetMapper(); contract.setBudget(bMapper.toContract(budgetDetail.getBudget())); } contract.setOriginalAmount(budgetDetail.getOriginalAmount()); contract.setApprovedAmount(budgetDetail.getApprovedAmount()); contract.setBudgetAvailable(budgetDetail.getBudgetAvailable()); contract.setAnticipatoryAmount(budgetDetail.getAnticipatoryAmount()); contract.setUsingDepartment(budgetDetail.getUsingDepartment()); contract.setExecutingDepartment(budgetDetail.getExecutingDepartment()); contract.setFunction(budgetDetail.getFunction()); contract.setScheme(budgetDetail.getScheme()); contract.setFund(budgetDetail.getFund()); contract.setSubScheme(budgetDetail.getSubScheme()); contract.setFunctionary(budgetDetail.getFunctionary()); contract.setBoundary(budgetDetail.getBoundary()); contract.setMaterializedPath(budgetDetail.getMaterializedPath()); contract.setDocumentNumber(budgetDetail.getDocumentNumber()); contract.setUniqueNo(budgetDetail.getUniqueNo()); contract.setPlanningPercent(budgetDetail.getPlanningPercent()); contract.setStatus(FinancialStatusContract.builder() .id(budgetDetail.getStatus() != null ? budgetDetail.getStatus().getId() : null).build()); contract.setCreatedBy(budgetDetail.getCreatedBy()); contract.setCreatedDate(budgetDetail.getCreatedDate()); contract.setLastModifiedBy(budgetDetail.getLastModifiedBy()); contract.setLastModifiedDate(budgetDetail.getLastModifiedDate()); contract.setTenantId(budgetDetail.getTenantId()); return contract; }  }
BudgetDetailMapper { public BudgetDetailContract toContract(final BudgetDetail budgetDetail) { final BudgetDetailContract contract = new BudgetDetailContract(); contract.setId(budgetDetail.getId()); contract.setBudgetGroup(budgetDetail.getBudgetGroup() != null ? budgetDetail.getBudgetGroup() : null); if (budgetDetail.getBudget() != null) { final BudgetMapper bMapper = new BudgetMapper(); contract.setBudget(bMapper.toContract(budgetDetail.getBudget())); } contract.setOriginalAmount(budgetDetail.getOriginalAmount()); contract.setApprovedAmount(budgetDetail.getApprovedAmount()); contract.setBudgetAvailable(budgetDetail.getBudgetAvailable()); contract.setAnticipatoryAmount(budgetDetail.getAnticipatoryAmount()); contract.setUsingDepartment(budgetDetail.getUsingDepartment()); contract.setExecutingDepartment(budgetDetail.getExecutingDepartment()); contract.setFunction(budgetDetail.getFunction()); contract.setScheme(budgetDetail.getScheme()); contract.setFund(budgetDetail.getFund()); contract.setSubScheme(budgetDetail.getSubScheme()); contract.setFunctionary(budgetDetail.getFunctionary()); contract.setBoundary(budgetDetail.getBoundary()); contract.setMaterializedPath(budgetDetail.getMaterializedPath()); contract.setDocumentNumber(budgetDetail.getDocumentNumber()); contract.setUniqueNo(budgetDetail.getUniqueNo()); contract.setPlanningPercent(budgetDetail.getPlanningPercent()); contract.setStatus(FinancialStatusContract.builder() .id(budgetDetail.getStatus() != null ? budgetDetail.getStatus().getId() : null).build()); contract.setCreatedBy(budgetDetail.getCreatedBy()); contract.setCreatedDate(budgetDetail.getCreatedDate()); contract.setLastModifiedBy(budgetDetail.getLastModifiedBy()); contract.setLastModifiedDate(budgetDetail.getLastModifiedDate()); contract.setTenantId(budgetDetail.getTenantId()); return contract; }  BudgetDetail toDomain(final BudgetDetailContract contract); BudgetDetailContract toContract(final BudgetDetail budgetDetail); BudgetDetailSearch toSearchDomain(final BudgetDetailSearchContract contract); BudgetDetailSearchContract toSearchContract(final BudgetDetailSearch budgetDetailSearch); }
BudgetDetailMapper { public BudgetDetailContract toContract(final BudgetDetail budgetDetail) { final BudgetDetailContract contract = new BudgetDetailContract(); contract.setId(budgetDetail.getId()); contract.setBudgetGroup(budgetDetail.getBudgetGroup() != null ? budgetDetail.getBudgetGroup() : null); if (budgetDetail.getBudget() != null) { final BudgetMapper bMapper = new BudgetMapper(); contract.setBudget(bMapper.toContract(budgetDetail.getBudget())); } contract.setOriginalAmount(budgetDetail.getOriginalAmount()); contract.setApprovedAmount(budgetDetail.getApprovedAmount()); contract.setBudgetAvailable(budgetDetail.getBudgetAvailable()); contract.setAnticipatoryAmount(budgetDetail.getAnticipatoryAmount()); contract.setUsingDepartment(budgetDetail.getUsingDepartment()); contract.setExecutingDepartment(budgetDetail.getExecutingDepartment()); contract.setFunction(budgetDetail.getFunction()); contract.setScheme(budgetDetail.getScheme()); contract.setFund(budgetDetail.getFund()); contract.setSubScheme(budgetDetail.getSubScheme()); contract.setFunctionary(budgetDetail.getFunctionary()); contract.setBoundary(budgetDetail.getBoundary()); contract.setMaterializedPath(budgetDetail.getMaterializedPath()); contract.setDocumentNumber(budgetDetail.getDocumentNumber()); contract.setUniqueNo(budgetDetail.getUniqueNo()); contract.setPlanningPercent(budgetDetail.getPlanningPercent()); contract.setStatus(FinancialStatusContract.builder() .id(budgetDetail.getStatus() != null ? budgetDetail.getStatus().getId() : null).build()); contract.setCreatedBy(budgetDetail.getCreatedBy()); contract.setCreatedDate(budgetDetail.getCreatedDate()); contract.setLastModifiedBy(budgetDetail.getLastModifiedBy()); contract.setLastModifiedDate(budgetDetail.getLastModifiedDate()); contract.setTenantId(budgetDetail.getTenantId()); return contract; }  BudgetDetail toDomain(final BudgetDetailContract contract); BudgetDetailContract toContract(final BudgetDetail budgetDetail); BudgetDetailSearch toSearchDomain(final BudgetDetailSearchContract contract); BudgetDetailSearchContract toSearchContract(final BudgetDetailSearch budgetDetailSearch);  }