Java Assert assertNotEmpty(String string, String exceptionMessageTitle)

Here you can find the source of assertNotEmpty(String string, String exceptionMessageTitle)

Description

assert Not Empty

License

Open Source License

Declaration

public static void assertNotEmpty(String string, String exceptionMessageTitle) 

Method Source Code

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

public class Main {
    public static void assertNotEmpty(String string, String exceptionMessageTitle) {
        if (isNullOrEmpty(string)) {
            throw new IllegalArgumentException(exceptionMessageTitle + " cannot be null or empty string");
        }//  w w w  . j a  v a 2s .  c  om
    }

    public static boolean isNullOrEmpty(String string) {
        return string == null || string.length() == 0;
    }
}

Related

  1. assertNotBlank(final String arg, final String message)
  2. assertNotBlank(final String value, final String exceptionMessage)
  3. assertNotBlank(final String... strings)
  4. assertNotBlankOrThrowException(final String... strings)
  5. assertNotEmpty(final String str)
  6. assertNotEmpty(String value, String message)
  7. assertNotEmptyString(final String s)
  8. assertNotEquals(final Object actual, final Object expected, final String name)
  9. assertNotMatches(String name, String regExp, String actual)