陈昶聿
3 天以前 5cbcb6cce6349c81defb99ef1c178affe38e81f8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package com.smartor.common.exception;
 
/**
 * 状态转换异常
 * 
 * @author smartor
 */
public class StateTransitionException extends RuntimeException {
    
    private static final long serialVersionUID = 1L;
 
    public StateTransitionException(String message) {
        super(message);
    }
 
    public StateTransitionException(String message, Throwable cause) {
        super(message, cause);
    }
 
    public StateTransitionException(String currentState, String targetState) {
        super(String.format("非法的状态转换: 从 [%s] 到 [%s]", currentState, targetState));
    }
}