@Test public void test_to_search_contract() { final BudgetSearchContract expectedSearchContract = budgetMapper.toSearchContract(searchDomain()); assertEquals(expectedSearchContract.getId(), searchContract().getId()); assertEquals(expectedSearchContract.getName(), searchContract().getName()); assertEquals(expectedSearchContract.getFinancialYear().getId(), searchContract().getFinancialYear().getId()); assertEquals(expectedSearchContract.getEstimationType(), searchContract().getEstimationType()); assertEquals(expectedSearchContract.getParent().getId(), searchContract().getParent().getId()); assertEquals(expectedSearchContract.getReferenceBudget().getId(), searchContract().getReferenceBudget().getId()); assertEquals(expectedSearchContract.getDescription(), searchContract().getDescription()); assertEquals(expectedSearchContract.getActive(), searchContract().getActive()); assertEquals(expectedSearchContract.getPrimaryBudget(), searchContract().getPrimaryBudget()); assertEquals(expectedSearchContract.getMaterializedPath(), searchContract().getMaterializedPath()); assertEquals(expectedSearchContract.getDocumentNumber(), searchContract().getDocumentNumber()); 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 BudgetSearchContract toSearchContract(final BudgetSearch budgetSearch) { final BudgetSearchContract contract = new BudgetSearchContract(); contract.setId(budgetSearch.getId()); contract.setName(budgetSearch.getName()); contract.setFinancialYear(FinancialYearContract.builder() .id(budgetSearch.getFinancialYear() != null ? budgetSearch.getFinancialYear().getId() : null).build()); contract.setEstimationType(budgetSearch.getEstimationType() != null ? EstimationTypeContract.valueOf(budgetSearch.getEstimationType().name()) : null); contract.setParent(BudgetContract.builder() .id(budgetSearch.getParent() != null ? budgetSearch.getParent().getId() : null).build()); contract.setDescription(budgetSearch.getDescription()); contract.setActive(budgetSearch.getActive()); contract.setPrimaryBudget(budgetSearch.getPrimaryBudget()); contract.setMaterializedPath(budgetSearch.getMaterializedPath()); contract.setReferenceBudget(BudgetContract.builder() .id(budgetSearch.getReferenceBudget() != null ? budgetSearch.getReferenceBudget().getId() : null) .build()); contract.setDocumentNumber(budgetSearch.getDocumentNumber()); contract.setStatus(FinancialStatusContract.builder() .id(budgetSearch.getStatus() != null ? budgetSearch.getStatus().getId() : null).build()); contract.setCreatedBy(budgetSearch.getCreatedBy()); contract.setCreatedDate(budgetSearch.getCreatedDate()); contract.setLastModifiedBy(budgetSearch.getLastModifiedBy()); contract.setLastModifiedDate(budgetSearch.getLastModifiedDate()); contract.setTenantId(budgetSearch.getTenantId()); contract.setPageSize(budgetSearch.getPageSize()); contract.setOffset(budgetSearch.getOffset()); return contract; }
BudgetMapper { public BudgetSearchContract toSearchContract(final BudgetSearch budgetSearch) { final BudgetSearchContract contract = new BudgetSearchContract(); contract.setId(budgetSearch.getId()); contract.setName(budgetSearch.getName()); contract.setFinancialYear(FinancialYearContract.builder() .id(budgetSearch.getFinancialYear() != null ? budgetSearch.getFinancialYear().getId() : null).build()); contract.setEstimationType(budgetSearch.getEstimationType() != null ? EstimationTypeContract.valueOf(budgetSearch.getEstimationType().name()) : null); contract.setParent(BudgetContract.builder() .id(budgetSearch.getParent() != null ? budgetSearch.getParent().getId() : null).build()); contract.setDescription(budgetSearch.getDescription()); contract.setActive(budgetSearch.getActive()); contract.setPrimaryBudget(budgetSearch.getPrimaryBudget()); contract.setMaterializedPath(budgetSearch.getMaterializedPath()); contract.setReferenceBudget(BudgetContract.builder() .id(budgetSearch.getReferenceBudget() != null ? budgetSearch.getReferenceBudget().getId() : null) .build()); contract.setDocumentNumber(budgetSearch.getDocumentNumber()); contract.setStatus(FinancialStatusContract.builder() .id(budgetSearch.getStatus() != null ? budgetSearch.getStatus().getId() : null).build()); contract.setCreatedBy(budgetSearch.getCreatedBy()); contract.setCreatedDate(budgetSearch.getCreatedDate()); contract.setLastModifiedBy(budgetSearch.getLastModifiedBy()); contract.setLastModifiedDate(budgetSearch.getLastModifiedDate()); contract.setTenantId(budgetSearch.getTenantId()); contract.setPageSize(budgetSearch.getPageSize()); contract.setOffset(budgetSearch.getOffset()); return contract; } }
BudgetMapper { public BudgetSearchContract toSearchContract(final BudgetSearch budgetSearch) { final BudgetSearchContract contract = new BudgetSearchContract(); contract.setId(budgetSearch.getId()); contract.setName(budgetSearch.getName()); contract.setFinancialYear(FinancialYearContract.builder() .id(budgetSearch.getFinancialYear() != null ? budgetSearch.getFinancialYear().getId() : null).build()); contract.setEstimationType(budgetSearch.getEstimationType() != null ? EstimationTypeContract.valueOf(budgetSearch.getEstimationType().name()) : null); contract.setParent(BudgetContract.builder() .id(budgetSearch.getParent() != null ? budgetSearch.getParent().getId() : null).build()); contract.setDescription(budgetSearch.getDescription()); contract.setActive(budgetSearch.getActive()); contract.setPrimaryBudget(budgetSearch.getPrimaryBudget()); contract.setMaterializedPath(budgetSearch.getMaterializedPath()); contract.setReferenceBudget(BudgetContract.builder() .id(budgetSearch.getReferenceBudget() != null ? budgetSearch.getReferenceBudget().getId() : null) .build()); contract.setDocumentNumber(budgetSearch.getDocumentNumber()); contract.setStatus(FinancialStatusContract.builder() .id(budgetSearch.getStatus() != null ? budgetSearch.getStatus().getId() : null).build()); contract.setCreatedBy(budgetSearch.getCreatedBy()); contract.setCreatedDate(budgetSearch.getCreatedDate()); contract.setLastModifiedBy(budgetSearch.getLastModifiedBy()); contract.setLastModifiedDate(budgetSearch.getLastModifiedDate()); contract.setTenantId(budgetSearch.getTenantId()); contract.setPageSize(budgetSearch.getPageSize()); contract.setOffset(budgetSearch.getOffset()); return contract; }  }
BudgetMapper { public BudgetSearchContract toSearchContract(final BudgetSearch budgetSearch) { final BudgetSearchContract contract = new BudgetSearchContract(); contract.setId(budgetSearch.getId()); contract.setName(budgetSearch.getName()); contract.setFinancialYear(FinancialYearContract.builder() .id(budgetSearch.getFinancialYear() != null ? budgetSearch.getFinancialYear().getId() : null).build()); contract.setEstimationType(budgetSearch.getEstimationType() != null ? EstimationTypeContract.valueOf(budgetSearch.getEstimationType().name()) : null); contract.setParent(BudgetContract.builder() .id(budgetSearch.getParent() != null ? budgetSearch.getParent().getId() : null).build()); contract.setDescription(budgetSearch.getDescription()); contract.setActive(budgetSearch.getActive()); contract.setPrimaryBudget(budgetSearch.getPrimaryBudget()); contract.setMaterializedPath(budgetSearch.getMaterializedPath()); contract.setReferenceBudget(BudgetContract.builder() .id(budgetSearch.getReferenceBudget() != null ? budgetSearch.getReferenceBudget().getId() : null) .build()); contract.setDocumentNumber(budgetSearch.getDocumentNumber()); contract.setStatus(FinancialStatusContract.builder() .id(budgetSearch.getStatus() != null ? budgetSearch.getStatus().getId() : null).build()); contract.setCreatedBy(budgetSearch.getCreatedBy()); contract.setCreatedDate(budgetSearch.getCreatedDate()); contract.setLastModifiedBy(budgetSearch.getLastModifiedBy()); contract.setLastModifiedDate(budgetSearch.getLastModifiedDate()); contract.setTenantId(budgetSearch.getTenantId()); contract.setPageSize(budgetSearch.getPageSize()); contract.setOffset(budgetSearch.getOffset()); return contract; }  Budget toDomain(final BudgetContract contract); BudgetContract toContract(final Budget budget); BudgetSearch toSearchDomain(final BudgetSearchContract contract); BudgetSearchContract toSearchContract(final BudgetSearch budgetSearch); }
BudgetMapper { public BudgetSearchContract toSearchContract(final BudgetSearch budgetSearch) { final BudgetSearchContract contract = new BudgetSearchContract(); contract.setId(budgetSearch.getId()); contract.setName(budgetSearch.getName()); contract.setFinancialYear(FinancialYearContract.builder() .id(budgetSearch.getFinancialYear() != null ? budgetSearch.getFinancialYear().getId() : null).build()); contract.setEstimationType(budgetSearch.getEstimationType() != null ? EstimationTypeContract.valueOf(budgetSearch.getEstimationType().name()) : null); contract.setParent(BudgetContract.builder() .id(budgetSearch.getParent() != null ? budgetSearch.getParent().getId() : null).build()); contract.setDescription(budgetSearch.getDescription()); contract.setActive(budgetSearch.getActive()); contract.setPrimaryBudget(budgetSearch.getPrimaryBudget()); contract.setMaterializedPath(budgetSearch.getMaterializedPath()); contract.setReferenceBudget(BudgetContract.builder() .id(budgetSearch.getReferenceBudget() != null ? budgetSearch.getReferenceBudget().getId() : null) .build()); contract.setDocumentNumber(budgetSearch.getDocumentNumber()); contract.setStatus(FinancialStatusContract.builder() .id(budgetSearch.getStatus() != null ? budgetSearch.getStatus().getId() : null).build()); contract.setCreatedBy(budgetSearch.getCreatedBy()); contract.setCreatedDate(budgetSearch.getCreatedDate()); contract.setLastModifiedBy(budgetSearch.getLastModifiedBy()); contract.setLastModifiedDate(budgetSearch.getLastModifiedDate()); contract.setTenantId(budgetSearch.getTenantId()); contract.setPageSize(budgetSearch.getPageSize()); contract.setOffset(budgetSearch.getOffset()); return contract; }  Budget toDomain(final BudgetContract contract); BudgetContract toContract(final Budget budget); BudgetSearch toSearchDomain(final BudgetSearchContract contract); BudgetSearchContract toSearchContract(final BudgetSearch budgetSearch);  }