List to Array of Different Type

List listBsPaymentOCRRuleTO = bsProductRegistrationInfoTOWS.getBsPaymentOCRRuleTO();;
BSPaymentOCRRuleTO[] arrOcrRules=new
.BSPaymentOCRRuleTO[listBsPaymentOCRRuleTO.size()];

Iterator itrOcrRule=listBsPaymentOCRRuleTO.iterator();
int arrIndex=0;
while (itrOcrRule.hasNext()) {
BsPaymentOCRRuleTO bsPaymentOCRRuleTO=(BsPaymentOCRRuleTO) itrOcrRule.next();

BSPaymentOCRRuleTO ocrRules =new BSPaymentOCRRuleTO();

ocrRules.setPositionNo(bsPaymentOCRRuleTO.getPositionNo());
ocrRules.setToPos(bsPaymentOCRRuleTO.getToPos());
ocrRules.setFromPos(bsPaymentOCRRuleTO.getFromPos());
arrOcrRules[arrIndex]=ocrRules;
arrIndex++;
}
bsProductRegistrationInfoTO.setBSPaymentOCRRuleTO(arrOcrRules);
return bsProductRegistrationInfoTO;

0 comments: