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