Created
August 6, 2013 20:49
-
-
Save gkhays/6168489 to your computer and use it in GitHub Desktop.
Quick and dirty C# style isNullOrEmpty helper for Java.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.test; | |
public class Utils | |
{ | |
private Utils() {} | |
/** | |
* Determines whether or not the given string is null or contains an empty | |
* value. | |
* @param s | |
* @return true if the given string is null or empty; otherwise returns false | |
*/ | |
public static boolean isNullOrEmpty(String s) | |
{ | |
if (s == null) return true; | |
return s.isEmpty(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment