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

com.github.antelopeframework.BizRuntimeException Maven / Gradle / Ivy

package com.github.antelopeframework;

import com.github.antelopeframework.text.format.MessageFormatter;


/**
 * 基础异常类型. 提供了类似slf4j风格的错误消息参数.
 * 
 * @author yangzhi
 *
 */
public class BizRuntimeException extends RuntimeException {
	private static final long serialVersionUID = 2489531688803100876L;

	/**
	 * 默认构造函数.
	 */
	public BizRuntimeException() {
		super();
	}

	/**
	 * 
	 * @param cause
	 */
	public BizRuntimeException(Throwable cause) {
		super(cause);
	}
	
	/**
	 * 
	 * @param cause
	 * @param format
	 * @param formatArgs
	 */
	public BizRuntimeException(Throwable cause, String format, Object... formatArgs) {
		super(getFormattedMessage(format, formatArgs), cause);
	}

	/**
	 * 
	 * @param format
	 * @param formatArgs
	 */
	public BizRuntimeException(String format, Object... formatArgs) {
		super(getFormattedMessage(format, formatArgs));
	}

	/**
	 * 
	 * @param format
	 * @param formatArgs
	 * @return
	 */
	protected static String getFormattedMessage(String format, Object... formatArgs) {
		return MessageFormatter.getFormattedMessage(format, formatArgs);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy