add constructor

This commit is contained in:
Looly 2021-08-26 23:40:28 +08:00
parent c0510a4c66
commit d66efef873
24 changed files with 146 additions and 67 deletions

View File

@ -24,6 +24,7 @@
* 【cron 】 Scheduler增加setThreadExecutorissue#I47A6N@Gitee
* 【core 】 CharsetDetector增加detect重载支持自定义缓存大小issue#I478E5@Gitee
* 【core 】 增加PartitionIterpr#402@Gitee
* 【all 】 增加异常爬栈开关pr#403@Gitee
### 🐞Bug修复
* 【core 】 修复MapUtil.sort比较器不一致返回原map的问题issue#I46AQJ@Gitee

View File

@ -27,8 +27,8 @@ public class DependencyException extends RuntimeException {
super(message, throwable);
}
public DependencyException( String message, Throwable throwable,boolean enableSuppression,boolean writableStackTrace) {
super(message, throwable,enableSuppression,writableStackTrace);
public DependencyException(String message, Throwable throwable, boolean enableSuppression, boolean writableStackTrace) {
super(message, throwable, enableSuppression, writableStackTrace);
}
public DependencyException(Throwable throwable, String messageTemplate, Object... params) {

View File

@ -26,8 +26,8 @@ public class NotInitedException extends RuntimeException {
super(message, throwable);
}
public NotInitedException( String message, Throwable throwable,boolean enableSuppression,boolean writableStackTrace) {
super(message, throwable,enableSuppression,writableStackTrace);
public NotInitedException(String message, Throwable throwable, boolean enableSuppression, boolean writableStackTrace) {
super(message, throwable, enableSuppression, writableStackTrace);
}
public NotInitedException(Throwable throwable, String messageTemplate, Object... params) {

View File

@ -6,7 +6,6 @@ import cn.hutool.core.util.StrUtil;
* 带有状态码的异常
*
* @author xiaoleilu
*
*/
public class StatefulException extends RuntimeException {
private static final long serialVersionUID = 6057602589533840889L;
@ -33,8 +32,8 @@ public class StatefulException extends RuntimeException {
super(msg, throwable);
}
public StatefulException( String message, Throwable throwable,boolean enableSuppression,boolean writableStackTrace) {
super(message, throwable,enableSuppression,writableStackTrace);
public StatefulException(String message, Throwable throwable, boolean enableSuppression, boolean writableStackTrace) {
super(message, throwable, enableSuppression, writableStackTrace);
}
public StatefulException(int status, String msg) {

View File

@ -4,9 +4,10 @@ import cn.hutool.core.util.StrUtil;
/**
* 工具类异常
*
* @author xiaoleilu
*/
public class UtilException extends RuntimeException{
public class UtilException extends RuntimeException {
private static final long serialVersionUID = 8247610319171014183L;
public UtilException(Throwable e) {
@ -25,8 +26,8 @@ public class UtilException extends RuntimeException{
super(message, throwable);
}
public UtilException( String message, Throwable throwable,boolean enableSuppression,boolean writableStackTrace) {
super(message, throwable,enableSuppression,writableStackTrace);
public UtilException(String message, Throwable throwable, boolean enableSuppression, boolean writableStackTrace) {
super(message, throwable, enableSuppression, writableStackTrace);
}
public UtilException(Throwable throwable, String messageTemplate, Object... params) {

View File

@ -4,23 +4,28 @@ import cn.hutool.core.util.StrUtil;
/**
* 定时任务异常
*
* @author xiaoleilu
*/
public class CronException extends RuntimeException{
public class CronException extends RuntimeException {
private static final long serialVersionUID = 1L;
public CronException(Throwable e) {
super(e.getMessage(), e);
}
public CronException(String message) {
super(message);
}
public CronException(String messageTemplate, Object... params) {
super(StrUtil.format(messageTemplate, params));
}
public CronException(String message, Throwable throwable, boolean enableSuppression, boolean writableStackTrace) {
super(message, throwable, enableSuppression, writableStackTrace);
}
public CronException(Throwable throwable, String messageTemplate, Object... params) {
super(StrUtil.format(messageTemplate, params), throwable);
}

View File

@ -27,6 +27,10 @@ public class CryptoException extends RuntimeException {
super(message, throwable);
}
public CryptoException(String message, Throwable throwable, boolean enableSuppression, boolean writableStackTrace) {
super(message, throwable, enableSuppression, writableStackTrace);
}
public CryptoException(Throwable throwable, String messageTemplate, Object... params) {
super(StrUtil.format(messageTemplate, params), throwable);
}

View File

@ -13,19 +13,23 @@ public class DbRuntimeException extends RuntimeException{
public DbRuntimeException(Throwable e) {
super(ExceptionUtil.getMessage(e), e);
}
public DbRuntimeException(String message) {
super(message);
}
public DbRuntimeException(String messageTemplate, Object... params) {
super(StrUtil.format(messageTemplate, params));
}
public DbRuntimeException(String message, Throwable throwable) {
super(message, throwable);
}
public DbRuntimeException(String message, Throwable throwable, boolean enableSuppression, boolean writableStackTrace) {
super(message, throwable, enableSuppression, writableStackTrace);
}
public DbRuntimeException(Throwable throwable, String messageTemplate, Object... params) {
super(StrUtil.format(messageTemplate, params), throwable);
}

View File

@ -5,7 +5,7 @@ import cn.hutool.core.util.StrUtil;
/**
* 压缩解压异常语言异常
*
*
* @author Looly
*/
public class CompressException extends RuntimeException {
@ -27,6 +27,10 @@ public class CompressException extends RuntimeException {
super(message, throwable);
}
public CompressException(String message, Throwable throwable, boolean enableSuppression, boolean writableStackTrace) {
super(message, throwable, enableSuppression, writableStackTrace);
}
public CompressException(Throwable throwable, String messageTemplate, Object... params) {
super(StrUtil.format(messageTemplate, params), throwable);
}

View File

@ -5,7 +5,7 @@ import cn.hutool.core.util.StrUtil;
/**
* 表达式语言异常
*
*
* @author Looly
*/
public class ExpressionException extends RuntimeException {
@ -27,6 +27,10 @@ public class ExpressionException extends RuntimeException {
super(message, throwable);
}
public ExpressionException(String message, Throwable throwable, boolean enableSuppression, boolean writableStackTrace) {
super(message, throwable, enableSuppression, writableStackTrace);
}
public ExpressionException(Throwable throwable, String messageTemplate, Object... params) {
super(StrUtil.format(messageTemplate, params), throwable);
}

View File

@ -5,7 +5,7 @@ import cn.hutool.core.util.StrUtil;
/**
* Ftp异常
*
*
* @author xiaoleilu
*/
public class FtpException extends RuntimeException {
@ -27,6 +27,10 @@ public class FtpException extends RuntimeException {
super(message, throwable);
}
public FtpException(String message, Throwable throwable, boolean enableSuppression, boolean writableStackTrace) {
super(message, throwable, enableSuppression, writableStackTrace);
}
public FtpException(Throwable throwable, String messageTemplate, Object... params) {
super(StrUtil.format(messageTemplate, params), throwable);
}

View File

@ -13,19 +13,23 @@ public class MailException extends RuntimeException{
public MailException(Throwable e) {
super(ExceptionUtil.getMessage(e), e);
}
public MailException(String message) {
super(message);
}
public MailException(String messageTemplate, Object... params) {
super(StrUtil.format(messageTemplate, params));
}
public MailException(String message, Throwable throwable) {
super(message, throwable);
}
public MailException(String message, Throwable throwable, boolean enableSuppression, boolean writableStackTrace) {
super(message, throwable, enableSuppression, writableStackTrace);
}
public MailException(Throwable throwable, String messageTemplate, Object... params) {
super(StrUtil.format(messageTemplate, params), throwable);
}

View File

@ -5,7 +5,7 @@ import cn.hutool.core.util.StrUtil;
/**
* 模板异常
*
*
* @author xiaoleilu
*/
public class PinyinException extends RuntimeException {
@ -27,6 +27,10 @@ public class PinyinException extends RuntimeException {
super(message, throwable);
}
public PinyinException(String message, Throwable throwable, boolean enableSuppression, boolean writableStackTrace) {
super(message, throwable, enableSuppression, writableStackTrace);
}
public PinyinException(Throwable throwable, String messageTemplate, Object... params) {
super(StrUtil.format(messageTemplate, params), throwable);
}

View File

@ -5,7 +5,7 @@ import cn.hutool.core.util.StrUtil;
/**
* Qrcode异常
*
*
* @author xiaoleilu
*/
public class QrCodeException extends RuntimeException {
@ -27,6 +27,10 @@ public class QrCodeException extends RuntimeException {
super(message, throwable);
}
public QrCodeException(String message, Throwable throwable, boolean enableSuppression, boolean writableStackTrace) {
super(message, throwable, enableSuppression, writableStackTrace);
}
public QrCodeException(Throwable throwable, String messageTemplate, Object... params) {
super(StrUtil.format(messageTemplate, params), throwable);
}

View File

@ -13,19 +13,23 @@ public class JschRuntimeException extends RuntimeException{
public JschRuntimeException(Throwable e) {
super(ExceptionUtil.getMessage(e), e);
}
public JschRuntimeException(String message) {
super(message);
}
public JschRuntimeException(String messageTemplate, Object... params) {
super(StrUtil.format(messageTemplate, params));
}
public JschRuntimeException(String message, Throwable throwable) {
super(message, throwable);
}
public JschRuntimeException(String message, Throwable throwable, boolean enableSuppression, boolean writableStackTrace) {
super(message, throwable, enableSuppression, writableStackTrace);
}
public JschRuntimeException(Throwable throwable, String messageTemplate, Object... params) {
super(StrUtil.format(messageTemplate, params), throwable);
}

View File

@ -5,7 +5,7 @@ import cn.hutool.core.util.StrUtil;
/**
* 模板异常
*
*
* @author xiaoleilu
*/
public class TemplateException extends RuntimeException {
@ -27,6 +27,10 @@ public class TemplateException extends RuntimeException {
super(message, throwable);
}
public TemplateException(String message, Throwable throwable, boolean enableSuppression, boolean writableStackTrace) {
super(message, throwable, enableSuppression, writableStackTrace);
}
public TemplateException(Throwable throwable, String messageTemplate, Object... params) {
super(StrUtil.format(messageTemplate, params), throwable);
}

View File

@ -5,7 +5,7 @@ import cn.hutool.core.util.StrUtil;
/**
* 分词异常
*
*
* @author Looly
*/
public class TokenizerException extends RuntimeException {
@ -27,6 +27,10 @@ public class TokenizerException extends RuntimeException {
super(message, throwable);
}
public TokenizerException(String message, Throwable throwable, boolean enableSuppression, boolean writableStackTrace) {
super(message, throwable, enableSuppression, writableStackTrace);
}
public TokenizerException(Throwable throwable, String messageTemplate, Object... params) {
super(StrUtil.format(messageTemplate, params), throwable);
}

View File

@ -3,28 +3,33 @@ package cn.hutool.http;
import cn.hutool.core.util.StrUtil;
/**
*HTTP异常
* HTTP异常
*
* @author xiaoleilu
*/
public class HttpException extends RuntimeException{
public class HttpException extends RuntimeException {
private static final long serialVersionUID = 8247610319171014183L;
public HttpException(Throwable e) {
super(e.getMessage(), e);
}
public HttpException(String message) {
super(message);
}
public HttpException(String messageTemplate, Object... params) {
super(StrUtil.format(messageTemplate, params));
}
public HttpException(String message, Throwable throwable) {
super(message, throwable);
}
public HttpException(String message, Throwable throwable, boolean enableSuppression, boolean writableStackTrace) {
super(message, throwable, enableSuppression, writableStackTrace);
}
public HttpException(Throwable throwable, String messageTemplate, Object... params) {
super(StrUtil.format(messageTemplate, params), throwable);
}

View File

@ -11,7 +11,7 @@ import cn.hutool.core.util.StrUtil;
*/
public class JSONException extends RuntimeException {
private static final long serialVersionUID = 0;
public JSONException(Throwable e) {
super(ExceptionUtil.getMessage(e), e);
}
@ -19,7 +19,7 @@ public class JSONException extends RuntimeException {
public JSONException(String message) {
super(message);
}
public JSONException(String messageTemplate, Object... params) {
super(StrUtil.format(messageTemplate, params));
}
@ -28,6 +28,10 @@ public class JSONException extends RuntimeException {
super(message, cause);
}
public JSONException(String message, Throwable throwable, boolean enableSuppression, boolean writableStackTrace) {
super(message, throwable, enableSuppression, writableStackTrace);
}
public JSONException(Throwable throwable, String messageTemplate, Object... params) {
super(StrUtil.format(messageTemplate, params), throwable);
}

View File

@ -28,6 +28,10 @@ public class JWTException extends RuntimeException {
super(message, cause);
}
public JWTException(String message, Throwable throwable, boolean enableSuppression, boolean writableStackTrace) {
super(message, throwable, enableSuppression, writableStackTrace);
}
public JWTException(Throwable throwable, String messageTemplate, Object... params) {
super(StrUtil.format(messageTemplate, params), throwable);
}

View File

@ -5,27 +5,32 @@ import cn.hutool.core.util.StrUtil;
/**
* POI异常
*
* @author xiaoleilu
*/
public class POIException extends RuntimeException{
public class POIException extends RuntimeException {
private static final long serialVersionUID = 2711633732613506552L;
public POIException(Throwable e) {
super(ExceptionUtil.getMessage(e), e);
}
public POIException(String message) {
super(message);
}
public POIException(String messageTemplate, Object... params) {
super(StrUtil.format(messageTemplate, params));
}
public POIException(String message, Throwable throwable) {
super(message, throwable);
}
public POIException(String message, Throwable throwable, boolean enableSuppression, boolean writableStackTrace) {
super(message, throwable, enableSuppression, writableStackTrace);
}
public POIException(Throwable throwable, String messageTemplate, Object... params) {
super(StrUtil.format(messageTemplate, params), throwable);
}

View File

@ -7,7 +7,7 @@ import javax.script.ScriptException;
/**
* 脚本运行时异常
*
*
* @author xiaoleilu
*/
public class ScriptRuntimeException extends RuntimeException {
@ -33,6 +33,10 @@ public class ScriptRuntimeException extends RuntimeException {
super(message, throwable);
}
public ScriptRuntimeException(String message, Throwable throwable, boolean enableSuppression, boolean writableStackTrace) {
super(message, throwable, enableSuppression, writableStackTrace);
}
public ScriptRuntimeException(Throwable throwable, String messageTemplate, Object... params) {
super(StrUtil.format(messageTemplate, params), throwable);
}
@ -40,10 +44,8 @@ public class ScriptRuntimeException extends RuntimeException {
/**
* Creates a <code>ScriptException</code> with message, filename and linenumber to be used in error messages.
*
* @param message The string to use in the message
*
* @param fileName The file or resource name describing the location of a script error causing the <code>ScriptException</code> to be thrown.
*
* @param message The string to use in the message
* @param fileName The file or resource name describing the location of a script error causing the <code>ScriptException</code> to be thrown.
* @param lineNumber A line number describing the location of a script error causing the <code>ScriptException</code> to be thrown.
*/
public ScriptRuntimeException(String message, String fileName, int lineNumber) {
@ -54,10 +56,10 @@ public class ScriptRuntimeException extends RuntimeException {
/**
* <code>ScriptException</code> constructor specifying message, filename, line number and column number.
*
* @param message The message.
* @param fileName The filename
* @param lineNumber the line number.
*
* @param message The message.
* @param fileName The filename
* @param lineNumber the line number.
* @param columnNumber the column number.
*/
public ScriptRuntimeException(String message, String fileName, int lineNumber, int columnNumber) {
@ -66,7 +68,7 @@ public class ScriptRuntimeException extends RuntimeException {
this.lineNumber = lineNumber;
this.columnNumber = columnNumber;
}
public ScriptRuntimeException(ScriptException e) {
super(e);
this.fileName = e.getFileName();
@ -76,7 +78,7 @@ public class ScriptRuntimeException extends RuntimeException {
/**
* Returns a message containing the String passed to a constructor as well as line and column numbers and filename if any of these are known.
*
*
* @return The error message.
*/
@Override
@ -98,7 +100,7 @@ public class ScriptRuntimeException extends RuntimeException {
/**
* Get the line number on which an error occurred.
*
*
* @return The line number. Returns -1 if a line number is unavailable.
*/
public int getLineNumber() {
@ -107,7 +109,7 @@ public class ScriptRuntimeException extends RuntimeException {
/**
* Get the column number on which an error occurred.
*
*
* @return The column number. Returns -1 if a column number is unavailable.
*/
public int getColumnNumber() {
@ -116,9 +118,9 @@ public class ScriptRuntimeException extends RuntimeException {
/**
* Get the source of the script causing the error.
*
*
* @return The file name of the script or some other string describing the script source. May return some implementation-defined string such as <i>&lt;unknown&gt;</i> if a description of the
* source is unavailable.
* source is unavailable.
*/
public String getFileName() {
return fileName;

View File

@ -4,27 +4,32 @@ import cn.hutool.core.util.StrUtil;
/**
* 设置异常
*
* @author xiaoleilu
*/
public class SettingRuntimeException extends RuntimeException{
public class SettingRuntimeException extends RuntimeException {
private static final long serialVersionUID = 7941096116780378387L;
public SettingRuntimeException(Throwable e) {
super(e);
}
public SettingRuntimeException(String message) {
super(message);
}
public SettingRuntimeException(String messageTemplate, Object... params) {
super(StrUtil.format(messageTemplate, params));
}
public SettingRuntimeException(String message, Throwable throwable) {
super(message, throwable);
}
public SettingRuntimeException(String message, Throwable throwable, boolean enableSuppression, boolean writableStackTrace) {
super(message, throwable, enableSuppression, writableStackTrace);
}
public SettingRuntimeException(Throwable throwable, String messageTemplate, Object... params) {
super(StrUtil.format(messageTemplate, params), throwable);
}

View File

@ -5,7 +5,7 @@ import cn.hutool.core.util.StrUtil;
/**
* Socket异常
*
*
* @author xiaoleilu
*/
public class SocketRuntimeException extends RuntimeException {
@ -27,6 +27,10 @@ public class SocketRuntimeException extends RuntimeException {
super(message, throwable);
}
public SocketRuntimeException(String message, Throwable throwable, boolean enableSuppression, boolean writableStackTrace) {
super(message, throwable, enableSuppression, writableStackTrace);
}
public SocketRuntimeException(Throwable throwable, String messageTemplate, Object... params) {
super(StrUtil.format(messageTemplate, params), throwable);
}