@Test public void test_to_search_domain() { InstrumentSearch expectedSearchDomain = instrumentMapper.toSearchDomain(searchContract()); assertEquals(expectedSearchDomain.getId(), searchDomain().getId()); assertEquals(expectedSearchDomain.getAmount(), searchDomain().getAmount()); assertEquals(expectedSearchDomain.getBank().getId(), searchDomain().getBank().getId()); assertEquals(expectedSearchDomain.getBankAccount().getId(), searchDomain().getBankAccount().getId()); assertEquals(expectedSearchDomain.getBranchName(), searchDomain().getBranchName()); assertEquals(expectedSearchDomain.getDrawer(), searchDomain().getDrawer()); assertEquals(expectedSearchDomain.getFinancialStatus().getCode(), searchDomain().getFinancialStatus().getCode()); assertEquals(expectedSearchDomain.getInstrumentType().getId(), searchDomain().getInstrumentType().getId()); assertEquals(expectedSearchDomain.getSurrenderReason().getId(), searchDomain().getSurrenderReason().getId()); assertEquals(expectedSearchDomain.getInstrumentVouchers().iterator().next().getVoucherHeaderId(), searchDomain().getInstrumentVouchers().iterator().next().getVoucherHeaderId()); assertEquals(expectedSearchDomain.getPayee(), searchDomain().getPayee()); assertEquals(expectedSearchDomain.getSerialNo(), searchDomain().getSerialNo()); assertEquals(expectedSearchDomain.getTransactionNumber(), searchDomain().getTransactionNumber()); assertEquals(expectedSearchDomain.getTransactionType(), searchDomain().getTransactionType()); assertEquals(expectedSearchDomain.getCreatedBy().getId(), searchDomain().getCreatedBy().getId()); assertEquals(expectedSearchDomain.getLastModifiedBy().getId(), searchDomain().getLastModifiedBy().getId()); assertEquals(expectedSearchDomain.getTenantId(), searchDomain().getTenantId()); assertEquals(expectedSearchDomain.getPageSize(), searchDomain().getPageSize()); assertEquals(expectedSearchDomain.getOffset(), searchDomain().getOffset()); }
public InstrumentSearch toSearchDomain(InstrumentSearchContract contract) { InstrumentSearch instrumentSearch = new InstrumentSearch(); instrumentSearch.setId(contract.getId()); instrumentSearch.setAmount(contract.getAmount()); instrumentSearch.setBank(contract.getBank()); instrumentSearch.setBankAccount(contract.getBankAccount()); instrumentSearch.setBranchName(contract.getBranchName()); instrumentSearch.setDrawer(contract.getDrawer()); instrumentSearch.setFinancialStatus(contract.getFinancialStatus()); instrumentSearch.setRemittanceVoucherId(contract.getRemittanceVoucherId()); if (contract.getInstrumentType() != null) instrumentSearch.setInstrumentType(typeMapper.toDomain(contract.getInstrumentType())); if (contract.getSurrenderReason() != null) instrumentSearch.setSurrenderReason(srMapper.toDomain(contract.getSurrenderReason())); if (contract.getInstrumentVouchers() != null) { List<InstrumentVoucher> instrumentVouchers = new ArrayList<>(); if (contract.getInstrumentVouchers() != null) for (InstrumentVoucherContract ivc : contract.getInstrumentVouchers()) instrumentVouchers.add(InstrumentVoucher.builder().voucherHeaderId(ivc.getVoucherHeaderId()) .receiptHeaderId(ivc.getReceiptHeaderId()).build()); instrumentSearch.setInstrumentVouchers(instrumentVouchers); } instrumentSearch.setPayee(contract.getPayee()); instrumentSearch.setSerialNo(contract.getSerialNo()); instrumentSearch.setTransactionDate(contract.getTransactionDate()); instrumentSearch.setTransactionNumber(contract.getTransactionNumber()); instrumentSearch.setTransactionType(contract.getTransactionType() != null ? TransactionType.valueOf(contract.getTransactionType().name()) : null); instrumentSearch.setPayinSlipId(contract.getPayinSlipId()); instrumentSearch.setReconciledAmount(contract.getReconciledAmount()); instrumentSearch.setReconciledOn(contract.getReconciledOn()); instrumentSearch.setCreatedBy(contract.getCreatedBy()); instrumentSearch.setCreatedDate(contract.getCreatedDate()); instrumentSearch.setLastModifiedBy(contract.getLastModifiedBy()); instrumentSearch.setLastModifiedDate(contract.getLastModifiedDate()); instrumentSearch.setTenantId(contract.getTenantId()); instrumentSearch.setPageSize(contract.getPageSize()); instrumentSearch.setOffset(contract.getOffset()); instrumentSearch.setSortBy(contract.getSortBy()); instrumentSearch.setIds(contract.getIds()); instrumentSearch.setInstrumentTypes(contract.getInstrumentTypes()); instrumentSearch.setFinancialStatuses(contract.getFinancialStatuses()); instrumentSearch.setTransactionFromDate(contract.getTransactionFromDate()); instrumentSearch.setTransactionToDate(contract.getTransactionToDate()); instrumentSearch.setDeleteReason(contract.getDeleteReason()); instrumentSearch.setReceiptIds(contract.getReceiptIds()); return instrumentSearch; }
InstrumentMapper { public InstrumentSearch toSearchDomain(InstrumentSearchContract contract) { InstrumentSearch instrumentSearch = new InstrumentSearch(); instrumentSearch.setId(contract.getId()); instrumentSearch.setAmount(contract.getAmount()); instrumentSearch.setBank(contract.getBank()); instrumentSearch.setBankAccount(contract.getBankAccount()); instrumentSearch.setBranchName(contract.getBranchName()); instrumentSearch.setDrawer(contract.getDrawer()); instrumentSearch.setFinancialStatus(contract.getFinancialStatus()); instrumentSearch.setRemittanceVoucherId(contract.getRemittanceVoucherId()); if (contract.getInstrumentType() != null) instrumentSearch.setInstrumentType(typeMapper.toDomain(contract.getInstrumentType())); if (contract.getSurrenderReason() != null) instrumentSearch.setSurrenderReason(srMapper.toDomain(contract.getSurrenderReason())); if (contract.getInstrumentVouchers() != null) { List<InstrumentVoucher> instrumentVouchers = new ArrayList<>(); if (contract.getInstrumentVouchers() != null) for (InstrumentVoucherContract ivc : contract.getInstrumentVouchers()) instrumentVouchers.add(InstrumentVoucher.builder().voucherHeaderId(ivc.getVoucherHeaderId()) .receiptHeaderId(ivc.getReceiptHeaderId()).build()); instrumentSearch.setInstrumentVouchers(instrumentVouchers); } instrumentSearch.setPayee(contract.getPayee()); instrumentSearch.setSerialNo(contract.getSerialNo()); instrumentSearch.setTransactionDate(contract.getTransactionDate()); instrumentSearch.setTransactionNumber(contract.getTransactionNumber()); instrumentSearch.setTransactionType(contract.getTransactionType() != null ? TransactionType.valueOf(contract.getTransactionType().name()) : null); instrumentSearch.setPayinSlipId(contract.getPayinSlipId()); instrumentSearch.setReconciledAmount(contract.getReconciledAmount()); instrumentSearch.setReconciledOn(contract.getReconciledOn()); instrumentSearch.setCreatedBy(contract.getCreatedBy()); instrumentSearch.setCreatedDate(contract.getCreatedDate()); instrumentSearch.setLastModifiedBy(contract.getLastModifiedBy()); instrumentSearch.setLastModifiedDate(contract.getLastModifiedDate()); instrumentSearch.setTenantId(contract.getTenantId()); instrumentSearch.setPageSize(contract.getPageSize()); instrumentSearch.setOffset(contract.getOffset()); instrumentSearch.setSortBy(contract.getSortBy()); instrumentSearch.setIds(contract.getIds()); instrumentSearch.setInstrumentTypes(contract.getInstrumentTypes()); instrumentSearch.setFinancialStatuses(contract.getFinancialStatuses()); instrumentSearch.setTransactionFromDate(contract.getTransactionFromDate()); instrumentSearch.setTransactionToDate(contract.getTransactionToDate()); instrumentSearch.setDeleteReason(contract.getDeleteReason()); instrumentSearch.setReceiptIds(contract.getReceiptIds()); return instrumentSearch; } }
InstrumentMapper { public InstrumentSearch toSearchDomain(InstrumentSearchContract contract) { InstrumentSearch instrumentSearch = new InstrumentSearch(); instrumentSearch.setId(contract.getId()); instrumentSearch.setAmount(contract.getAmount()); instrumentSearch.setBank(contract.getBank()); instrumentSearch.setBankAccount(contract.getBankAccount()); instrumentSearch.setBranchName(contract.getBranchName()); instrumentSearch.setDrawer(contract.getDrawer()); instrumentSearch.setFinancialStatus(contract.getFinancialStatus()); instrumentSearch.setRemittanceVoucherId(contract.getRemittanceVoucherId()); if (contract.getInstrumentType() != null) instrumentSearch.setInstrumentType(typeMapper.toDomain(contract.getInstrumentType())); if (contract.getSurrenderReason() != null) instrumentSearch.setSurrenderReason(srMapper.toDomain(contract.getSurrenderReason())); if (contract.getInstrumentVouchers() != null) { List<InstrumentVoucher> instrumentVouchers = new ArrayList<>(); if (contract.getInstrumentVouchers() != null) for (InstrumentVoucherContract ivc : contract.getInstrumentVouchers()) instrumentVouchers.add(InstrumentVoucher.builder().voucherHeaderId(ivc.getVoucherHeaderId()) .receiptHeaderId(ivc.getReceiptHeaderId()).build()); instrumentSearch.setInstrumentVouchers(instrumentVouchers); } instrumentSearch.setPayee(contract.getPayee()); instrumentSearch.setSerialNo(contract.getSerialNo()); instrumentSearch.setTransactionDate(contract.getTransactionDate()); instrumentSearch.setTransactionNumber(contract.getTransactionNumber()); instrumentSearch.setTransactionType(contract.getTransactionType() != null ? TransactionType.valueOf(contract.getTransactionType().name()) : null); instrumentSearch.setPayinSlipId(contract.getPayinSlipId()); instrumentSearch.setReconciledAmount(contract.getReconciledAmount()); instrumentSearch.setReconciledOn(contract.getReconciledOn()); instrumentSearch.setCreatedBy(contract.getCreatedBy()); instrumentSearch.setCreatedDate(contract.getCreatedDate()); instrumentSearch.setLastModifiedBy(contract.getLastModifiedBy()); instrumentSearch.setLastModifiedDate(contract.getLastModifiedDate()); instrumentSearch.setTenantId(contract.getTenantId()); instrumentSearch.setPageSize(contract.getPageSize()); instrumentSearch.setOffset(contract.getOffset()); instrumentSearch.setSortBy(contract.getSortBy()); instrumentSearch.setIds(contract.getIds()); instrumentSearch.setInstrumentTypes(contract.getInstrumentTypes()); instrumentSearch.setFinancialStatuses(contract.getFinancialStatuses()); instrumentSearch.setTransactionFromDate(contract.getTransactionFromDate()); instrumentSearch.setTransactionToDate(contract.getTransactionToDate()); instrumentSearch.setDeleteReason(contract.getDeleteReason()); instrumentSearch.setReceiptIds(contract.getReceiptIds()); return instrumentSearch; }  }
InstrumentMapper { public InstrumentSearch toSearchDomain(InstrumentSearchContract contract) { InstrumentSearch instrumentSearch = new InstrumentSearch(); instrumentSearch.setId(contract.getId()); instrumentSearch.setAmount(contract.getAmount()); instrumentSearch.setBank(contract.getBank()); instrumentSearch.setBankAccount(contract.getBankAccount()); instrumentSearch.setBranchName(contract.getBranchName()); instrumentSearch.setDrawer(contract.getDrawer()); instrumentSearch.setFinancialStatus(contract.getFinancialStatus()); instrumentSearch.setRemittanceVoucherId(contract.getRemittanceVoucherId()); if (contract.getInstrumentType() != null) instrumentSearch.setInstrumentType(typeMapper.toDomain(contract.getInstrumentType())); if (contract.getSurrenderReason() != null) instrumentSearch.setSurrenderReason(srMapper.toDomain(contract.getSurrenderReason())); if (contract.getInstrumentVouchers() != null) { List<InstrumentVoucher> instrumentVouchers = new ArrayList<>(); if (contract.getInstrumentVouchers() != null) for (InstrumentVoucherContract ivc : contract.getInstrumentVouchers()) instrumentVouchers.add(InstrumentVoucher.builder().voucherHeaderId(ivc.getVoucherHeaderId()) .receiptHeaderId(ivc.getReceiptHeaderId()).build()); instrumentSearch.setInstrumentVouchers(instrumentVouchers); } instrumentSearch.setPayee(contract.getPayee()); instrumentSearch.setSerialNo(contract.getSerialNo()); instrumentSearch.setTransactionDate(contract.getTransactionDate()); instrumentSearch.setTransactionNumber(contract.getTransactionNumber()); instrumentSearch.setTransactionType(contract.getTransactionType() != null ? TransactionType.valueOf(contract.getTransactionType().name()) : null); instrumentSearch.setPayinSlipId(contract.getPayinSlipId()); instrumentSearch.setReconciledAmount(contract.getReconciledAmount()); instrumentSearch.setReconciledOn(contract.getReconciledOn()); instrumentSearch.setCreatedBy(contract.getCreatedBy()); instrumentSearch.setCreatedDate(contract.getCreatedDate()); instrumentSearch.setLastModifiedBy(contract.getLastModifiedBy()); instrumentSearch.setLastModifiedDate(contract.getLastModifiedDate()); instrumentSearch.setTenantId(contract.getTenantId()); instrumentSearch.setPageSize(contract.getPageSize()); instrumentSearch.setOffset(contract.getOffset()); instrumentSearch.setSortBy(contract.getSortBy()); instrumentSearch.setIds(contract.getIds()); instrumentSearch.setInstrumentTypes(contract.getInstrumentTypes()); instrumentSearch.setFinancialStatuses(contract.getFinancialStatuses()); instrumentSearch.setTransactionFromDate(contract.getTransactionFromDate()); instrumentSearch.setTransactionToDate(contract.getTransactionToDate()); instrumentSearch.setDeleteReason(contract.getDeleteReason()); instrumentSearch.setReceiptIds(contract.getReceiptIds()); return instrumentSearch; }  Instrument toDomain(InstrumentContract contract); InstrumentContract toContract(Instrument instrument); InstrumentSearch toSearchDomain(InstrumentSearchContract contract); InstrumentSearchContract toSearchContract(InstrumentSearch instrumentSearch); }
InstrumentMapper { public InstrumentSearch toSearchDomain(InstrumentSearchContract contract) { InstrumentSearch instrumentSearch = new InstrumentSearch(); instrumentSearch.setId(contract.getId()); instrumentSearch.setAmount(contract.getAmount()); instrumentSearch.setBank(contract.getBank()); instrumentSearch.setBankAccount(contract.getBankAccount()); instrumentSearch.setBranchName(contract.getBranchName()); instrumentSearch.setDrawer(contract.getDrawer()); instrumentSearch.setFinancialStatus(contract.getFinancialStatus()); instrumentSearch.setRemittanceVoucherId(contract.getRemittanceVoucherId()); if (contract.getInstrumentType() != null) instrumentSearch.setInstrumentType(typeMapper.toDomain(contract.getInstrumentType())); if (contract.getSurrenderReason() != null) instrumentSearch.setSurrenderReason(srMapper.toDomain(contract.getSurrenderReason())); if (contract.getInstrumentVouchers() != null) { List<InstrumentVoucher> instrumentVouchers = new ArrayList<>(); if (contract.getInstrumentVouchers() != null) for (InstrumentVoucherContract ivc : contract.getInstrumentVouchers()) instrumentVouchers.add(InstrumentVoucher.builder().voucherHeaderId(ivc.getVoucherHeaderId()) .receiptHeaderId(ivc.getReceiptHeaderId()).build()); instrumentSearch.setInstrumentVouchers(instrumentVouchers); } instrumentSearch.setPayee(contract.getPayee()); instrumentSearch.setSerialNo(contract.getSerialNo()); instrumentSearch.setTransactionDate(contract.getTransactionDate()); instrumentSearch.setTransactionNumber(contract.getTransactionNumber()); instrumentSearch.setTransactionType(contract.getTransactionType() != null ? TransactionType.valueOf(contract.getTransactionType().name()) : null); instrumentSearch.setPayinSlipId(contract.getPayinSlipId()); instrumentSearch.setReconciledAmount(contract.getReconciledAmount()); instrumentSearch.setReconciledOn(contract.getReconciledOn()); instrumentSearch.setCreatedBy(contract.getCreatedBy()); instrumentSearch.setCreatedDate(contract.getCreatedDate()); instrumentSearch.setLastModifiedBy(contract.getLastModifiedBy()); instrumentSearch.setLastModifiedDate(contract.getLastModifiedDate()); instrumentSearch.setTenantId(contract.getTenantId()); instrumentSearch.setPageSize(contract.getPageSize()); instrumentSearch.setOffset(contract.getOffset()); instrumentSearch.setSortBy(contract.getSortBy()); instrumentSearch.setIds(contract.getIds()); instrumentSearch.setInstrumentTypes(contract.getInstrumentTypes()); instrumentSearch.setFinancialStatuses(contract.getFinancialStatuses()); instrumentSearch.setTransactionFromDate(contract.getTransactionFromDate()); instrumentSearch.setTransactionToDate(contract.getTransactionToDate()); instrumentSearch.setDeleteReason(contract.getDeleteReason()); instrumentSearch.setReceiptIds(contract.getReceiptIds()); return instrumentSearch; }  Instrument toDomain(InstrumentContract contract); InstrumentContract toContract(Instrument instrument); InstrumentSearch toSearchDomain(InstrumentSearchContract contract); InstrumentSearchContract toSearchContract(InstrumentSearch instrumentSearch);  }