Created
December 3, 2016 11:30
-
-
Save hoangbits/867ee5305908f9e0a1eca59c3aeef013 to your computer and use it in GitHub Desktop.
uninstantiatable
This file contains hidden or 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
/** | |
* 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