Advertisement
Guest User

Untitled

a guest
Dec 3rd, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. /**
  2. * Created by HoangLG on 12/3/2016.
  3. */
  4. public class FormUtils {
  5. public static boolean isMissing(String value){
  6. return value == null || value.trim().isEmpty();
  7. }
  8.  
  9. public static boolean isAnyMissing(String... values) {
  10. boolean isMissing = false;
  11. for (String value : values) {
  12. if (isMissing(value)) {
  13. isMissing = true;
  14. break;
  15. }
  16. }
  17. return (isMissing);
  18. }
  19.  
  20. public static String wordForCopies(int n) {
  21. if (n == 1) {
  22. return "copy";
  23. }else{
  24. return "copies";
  25. }
  26. }
  27. // Uninstantiatable class. Static methods only.
  28. private FormUtils() {
  29.  
  30. }
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement