All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.moon.core.util.AssertException Maven / Gradle / Ivy

package com.moon.core.util;

import static java.lang.String.format;

/**
 * @author moonsky
 */
public class AssertException extends RuntimeException {

    public AssertException() { }

    public AssertException(String message) { super(message); }

    public AssertException(String message, Throwable cause) { super(message, cause); }

    public AssertException(Throwable cause) { super(cause); }

    public AssertException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
        super(message, cause, enableSuppression, writableStackTrace);
    }

    public static  T doThrow(String message) { throw new AssertException(message); }

    static  T throwNull(String message) { throw new NullPointerException(message); }

    static  T throwIllegal(String message) { throw new IllegalArgumentException(message); }

    static  T throwIllegal(String template, Object... args) { return throwIllegal(format(template, args)); }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy