Java tutorial
//package com.java2s; public class Main { public static String checkField(CharSequence text) { String str = null; if (text != null) { str = text.toString(); if (str != null && str.length() > 0 && !str.equals("null")) { return str; } } return null; } }