String null to empty

You can use Objects.toString() (standard in Java 7):

Objects.toString(gearBox, "")

Objects.toString(id, "")

or 

StringUtils.defaultString(String str)

Returns either the passed in String, or if the String is null, an empty String ("").
 StringUtils.defaultString(null)  = ""
 StringUtils.defaultString("")    = ""
 StringUtils.defaultString("bat") = "bat"

Không có nhận xét nào:

Redirect www.example.com to example.com

 https://stackoverflow.com/questions/39303725/virtual-host-force-https-and-redirect-www-to-non-www-but-no-other-subdomains With the proper u...