package org.dbflute.intro.bizfw.util;

/**
 * parameter assertion util.
 * @author cabos
 */
public class AssertUtil {

    public static void assertNotNull(Object... params) {
        if (params == null) {
            throw new AssertNotNullException("Parameter is null.");
        }
        for (int i = 0; i < params.length; i++) {
            if (params[i] != null) {
                continue;
            }
            throw new AssertNotNullException("Parameter " + i + "  is null.");
        }
    }

    public static class AssertNotNullException extends RuntimeException {
        AssertNotNullException(String message) {
            super(message);
        }
    }
}

@@ -113,16 +113,98 @@
 Util %7B%0A%0A
+    /**%0A     * Assert Not null.%0A     * @param params parameters (NotNull)%0A     */%0A
     publ
@@ -749,11 +749,786 @@
  %7D%0A    %7D
+%0A%0A    /**%0A     * Assert Not null and Empty.%0A     * @param params parameters (Not Null & Empty)%0A     */%0A    public static void assertNotEmpty(String... params) %7B%0A        if (params == null) %7B%0A            throw new AssertNotNullException(%22Parameter is null.%22);%0A        %7D%0A        for (int i = 0; i %3C params.length; i++) %7B%0A            if (params%5Bi%5D == null) %7B%0A                throw new AssertNotNullException(%22Parameter %22 + i + %22  is null.%22);%0A            %7D%0A            if (params%5Bi%5D.isEmpty()) %7B%0A                throw new AssertNotEmptyException(%22Parameter %22 + i + %22  is null.%22);%0A            %7D%0A        %7D%0A    %7D%0A%0A    public static class AssertNotEmptyException extends RuntimeException %7B%0A        AssertNotEmptyException(String message) %7B%0A            super(message);%0A        %7D%0A    %7D
 %0A%7D%0A

add assertion util