Java Assert assertNonEmpty(String s, String name)

Here you can find the source of assertNonEmpty(String s, String name)

Description

assert Non Empty

License

Apache License

Declaration

public static String assertNonEmpty(String s, String name) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static String assertNonEmpty(String s, String name) {
        if (s == null || s.length() == 0) {
            throw new IllegalArgumentException(name + " must not be null or empty");
        }/*w w w.ja  va  2 s.  c o  m*/
        return s;
    }
}

Related

  1. assertLongPositive(long val, String name)
  2. assertMandatoryParameter(boolean assertion, String parameterName)
  3. assertMatches(String name, String regExp, String actual)
  4. assertMergeTestPostcondition(double[] arr, long[] brr, int arrLen)
  5. assertMessageEquals(Throwable ex, String msg)
  6. assertNonFatal(boolean test, String msg)
  7. assertNonNegative(int field, String fieldName)
  8. assertNonZero(int i, String fieldName)
  9. assertNoSlash(final String ofString)