BusinessException.java 982 Bytes
package org.nafmii.common.exception;

import javax.servlet.http.HttpServletResponse;

public class BusinessException extends RuntimeException {

    private static final long serialVersionUID = 1L;

    private Integer statusCode;

    public BusinessException() {
        super ();
        this.statusCode = HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
    }

    public BusinessException(String message) {
        super (message);
        this.statusCode = HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
    }

    public BusinessException(Integer statusCode, String message) {
        super (message);
        this.statusCode = statusCode;
    }

    public BusinessException(Long statusCode, String message) {
        super (message);
        this.statusCode = Integer.parseInt(statusCode.toString());
    }

    public Integer getStatusCode() {
        return statusCode;
    }

    public void setStatusCode(Integer statusCode) {
        this.statusCode = statusCode;
    }
}