Here you can find the source of nullToEmpty(String url)
Parameter | Description |
---|---|
url | URL parameter to normalize |
public static String nullToEmpty(String url)
//package com.java2s; public class Main { public static final String EMPTY = ""; public static final String NULL = "null"; /**//from www . j a v a 2 s . c o m * Use to normalize URL parameters by returning * empty string instead of null or "null". * @param url URL parameter to normalize * @return Normalized parameter */ public static String nullToEmpty(String url) { if (null == url || url.equals(NULL)) return EMPTY; return url; } }