Java Assert assertNotBlank(final String... strings)

Here you can find the source of assertNotBlank(final String... strings)

Description

assert Not Blank

License

Open Source License

Parameter

Parameter Description
strings - The list of String to check.

Return

true if no String is null or blank, false otherwise.

Declaration

public static boolean assertNotBlank(final String... strings) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**/*  w  w w.  ja v  a 2s.c  om*/
     * @param strings - The list of String to check.
     * @return <code>true</code> if no <tt>String</tt> is null or blank,
     *         <code>false</code> otherwise.
     */
    public static boolean assertNotBlank(final String... strings) {
        for (String s : strings) {
            if (s == null || s.trim().isEmpty())
                return false;
        }
        return true;
    }
}

Related

  1. assertNonNegative(int field, String fieldName)
  2. assertNonZero(int i, String fieldName)
  3. assertNoSlash(final String ofString)
  4. assertNotBlank(final String arg, final String message)
  5. assertNotBlank(final String value, final String exceptionMessage)
  6. assertNotBlankOrThrowException(final String... strings)
  7. assertNotEmpty(final String str)
  8. assertNotEmpty(String string, String exceptionMessageTitle)
  9. assertNotEmpty(String value, String message)