Here you can find the source of nullToZero(BigDecimal num)
public static BigDecimal nullToZero(BigDecimal num)
//package com.java2s; //License from project: LGPL import java.math.BigDecimal; public class Main { public static BigDecimal nullToZero(BigDecimal num) { if (num == null) { return new BigDecimal("0"); }// w w w .jav a 2 s. c o m return num; } public static Long nullToZero(Long num) { if (num == null) { return new Long("0"); } return num; } public static BigDecimal nullToZero(String num) { if (num == null) { return new BigDecimal("0"); } return new BigDecimal(num); } public static Integer nullToZero(Integer num) { if (num == null) { return new Integer("0"); } return num; } }