Skip to content

Instantly share code, notes, and snippets.

@hoangbits
Created December 3, 2016 11:30
Show Gist options
  • Save hoangbits/867ee5305908f9e0a1eca59c3aeef013 to your computer and use it in GitHub Desktop.
Save hoangbits/867ee5305908f9e0a1eca59c3aeef013 to your computer and use it in GitHub Desktop.
uninstantiatable
/**
* Created by HoangLG on 12/3/2016.
*/
public class FormUtils {
public static boolean isMissing(String value){
return value == null || value.trim().isEmpty();
}
public static boolean isAnyMissing(String... values) {
boolean isMissing = false;
for (String value : values) {
if (isMissing(value)) {
isMissing = true;
break;
}
}
return (isMissing);
}
public static String wordForCopies(int n) {
if (n == 1) {
return "copy";
}else{
return "copies";
}
}
// Uninstantiatable class. Static methods only.
private FormUtils() {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment