Java tutorial
//package com.java2s; public class Main { public static int nullAs(Integer integer, int i) { if (integer != null) i = integer.intValue(); return i; } public static long nullAs(Long long1, long l) { if (long1 != null) l = long1.longValue(); return l; } public static String nullAs(String s, String s1) { if (s != null) s1 = s; return s1; } public static boolean nullAs(Boolean boolean1, boolean flag) { if (boolean1 != null) flag = boolean1.booleanValue(); return flag; } }