public class UserPaymentMapper {
Logger logger = Logger.getLogger(UserPaymentMapper.class);
public UserPaymentUI toUIBean(UserPayment data) {
UserPaymentUI uiBean = null;
if (data != null) {
uiBean = new UserPaymentUI();
uiBean.setAmount(data.getAmount());
uiBean.setId(data.getId());
uiBean.setNotes(data.getNotes());
uiBean.setPaymentDate(data.getPaymentDate());
uiBean.setPaymentType(data.getPaymentType());
if (data.getUser() != null) {
uiBean.setUserName(data.getUser().getUsername());
}
}
logger.debug("Payment is :: " + uiBean);