@@ -0,0 +1,2027 @@
+package br.com.delogic.asd.exception;%0A%0Aimport org.springframework.util.Assert;%0A%0Aimport br.com.delogic.jfunk.Has;%0A%0A/**%0A * Exception que ser%C3%A1 lan%C3%A7ada caso alguma processamento precise ser interrompido%0A * por%C3%A9m n%C3%A3o %C3%A9 uma regra de neg%C3%B3cio.%0A *%0A * @author C%C3%A9lio%0A *%0A */%0A@SuppressWarnings(%22serial%22)%0Apublic class ProcessException extends AsdException %7B%0A%0A    private ProcessException parent;%0A%0A    public ProcessException(String message) %7B%0A        super(message);%0A    %7D%0A%0A    public ProcessException() %7B%0A        super(null);%0A    %7D%0A%0A    public static ProcessException of(String message) %7B%0A        return new ProcessException(message);%0A    %7D%0A%0A    /**%0A     * Retorna uma exception que faz equals com o tipo principal, permitindo%0A     * compara%C3%A7%C3%A3o com uma %C3%BAnica inst%C3%A2ncia.%0A     *%0A     * @param message%0A     * @param params%0A     * @return%0A     */%0A    private ProcessException withMessage(String message, Object... params) %7B%0A        ProcessException ex = new ProcessException(Has.content(params) ? String.format(message, params) : message) %7B%0A            @Override%0A            public boolean equals(Object obj) %7B%0A                return ProcessException.this == obj;%0A            %7D%0A        %7D;%0A        ex.parent = this;%0A        return ex;%0A    %7D%0A%0A    public ProcessException thrownIf(boolean condition) throws ProcessException %7B%0A        Assert.hasText(getMessage());%0A        if (condition) %7B%0A            throw this;%0A        %7D%0A        return this;%0A    %7D%0A%0A    public ProcessException thrownIf(boolean condition, String message, Object... params) throws ProcessException %7B%0A        Assert.hasText(message);%0A        if (condition) %7B%0A            throw withMessage(message, params);%0A        %7D%0A        return this;%0A    %7D%0A%0A    @Override%0A    public boolean equals(Object obj) %7B%0A        if (!(obj instanceof ProcessException)) %7B%0A            return false;%0A        %7D%0A        ProcessException that = (ProcessException) obj;%0A        return this == that %7C%7C this == that.parent;%0A    %7D%0A%0A    public boolean is(ProcessException ex) %7B%0A        return equals(ex);%0A    %7D%0A%0A%7D%0A

Add exception for interrupted processing