Skip to content

Instantly share code, notes, and snippets.

@devkhan
Created February 7, 2017 11:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devkhan/d82c955e7930162c1f9cf455a7685478 to your computer and use it in GitHub Desktop.
Save devkhan/d82c955e7930162c1f9cf455a7685478 to your computer and use it in GitHub Desktop.
public class FUtility {
public FUtility() {}
public static boolean isEmpty(Object object) {
return object == null ? true : false;
}
public static boolean isNotEmpty(Object object) {
return object == null ? false : true;
}
public static boolean isEmpty(String str) {
return str == null || (str != null && "".equals(str)) ? true : false;
}
public static boolean isNotEmpty(String str) {
return str == null || (str != null && "".equals(str)) ? false : true;
}
public static String getModifiedString(Object obj) {
return isEmpty(obj) ? "" : ("null".equalsIgnoreCase((String) obj) ? "" : (String) obj);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment