Java tutorial
//package com.java2s; import android.support.annotation.Nullable; import android.text.TextUtils; public class Main { @Nullable public static String nullableString(@Nullable String str) { return TextUtils.isEmpty(str) ? null : str; } }