financialaccountdtoassembler.java
来自「EJB+Struts+Webservice实现的开放式基金管理系统」· Java 代码 · 共 62 行
JAVA
62 行
package com.fund.client;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Collection;
import java.util.List;
/**
*
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2005</p>
*
* <p>Company: </p>
*
* @author not attributable
* @version 1.0
*/
public class FinancialAccountDtoAssembler {
/**
*
* @param financialAccount FinancialAccount
* @return FinancialAccountDto
*/
public static FinancialAccountDto createDto(FinancialAccount
financialAccount) {
FinancialAccountDto financialAccountDto = new FinancialAccountDto();
if (financialAccount != null) {
financialAccountDto.setAccountNo(financialAccount.getAccountNo());
financialAccountDto.setClientNo(financialAccount.getClientNo());
financialAccountDto.setFinancingAmount(financialAccount.
getFinancingAmount());
financialAccountDto
.setCreatedDate(financialAccount.getCreatedDate());
financialAccountDto.setStatus(financialAccount.getStatus());
financialAccountDto.setPassword(financialAccount.getPassword());
}
return financialAccountDto;
}
/**
*
* @param financialAccounts Collection
* @return FinancialAccountDto[]
*/
public static FinancialAccountDto[] createDtos(
Collection financialAccounts) {
List list = new ArrayList();
if (financialAccounts != null) {
Iterator iterator = financialAccounts.iterator();
while (iterator.hasNext()) {
list.add(createDto((FinancialAccount) iterator.next()));
}
}
FinancialAccountDto[] returnArray
= new FinancialAccountDto[list.size()];
return (FinancialAccountDto[]) list.toArray(returnArray);
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?