UsernameDuplicateException.java 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. package J20250802.demo04;
  2. import java.security.PrivilegedActionException;
  3. /**
  4. * @author WanJl
  5. * @version 1.0
  6. * @title UsernameDuplicateException
  7. * @description
  8. * @create 2025/8/2
  9. */
  10. public class UsernameDuplicateException extends RuntimeException{
  11. /**
  12. * Constructs a new exception with {@code null} as its detail message.
  13. * The cause is not initialized, and may subsequently be initialized by a
  14. * call to {@link #initCause}.
  15. */
  16. public UsernameDuplicateException() {
  17. }
  18. /**
  19. * Constructs a new exception with the specified detail message. The
  20. * cause is not initialized, and may subsequently be initialized by
  21. * a call to {@link #initCause}.
  22. *
  23. * @param message the detail message. The detail message is saved for
  24. * later retrieval by the {@link #getMessage()} method.
  25. */
  26. public UsernameDuplicateException(String message) {
  27. super(message);
  28. }
  29. /**
  30. * Constructs a new exception with the specified detail message and
  31. * cause. <p>Note that the detail message associated with
  32. * {@code cause} is <i>not</i> automatically incorporated in
  33. * this exception's detail message.
  34. *
  35. * @param message the detail message (which is saved for later retrieval
  36. * by the {@link #getMessage()} method).
  37. * @param cause the cause (which is saved for later retrieval by the
  38. * {@link #getCause()} method). (A <tt>null</tt> value is
  39. * permitted, and indicates that the cause is nonexistent or
  40. * unknown.)
  41. * @since 1.4
  42. */
  43. public UsernameDuplicateException(String message, Throwable cause) {
  44. super(message, cause);
  45. }
  46. /**
  47. * Constructs a new exception with the specified cause and a detail
  48. * message of <tt>(cause==null ? null : cause.toString())</tt> (which
  49. * typically contains the class and detail message of <tt>cause</tt>).
  50. * This constructor is useful for exceptions that are little more than
  51. * wrappers for other throwables (for example, {@link
  52. * PrivilegedActionException}).
  53. *
  54. * @param cause the cause (which is saved for later retrieval by the
  55. * {@link #getCause()} method). (A <tt>null</tt> value is
  56. * permitted, and indicates that the cause is nonexistent or
  57. * unknown.)
  58. * @since 1.4
  59. */
  60. public UsernameDuplicateException(Throwable cause) {
  61. super(cause);
  62. }
  63. /**
  64. * Constructs a new exception with the specified detail message,
  65. * cause, suppression enabled or disabled, and writable stack
  66. * trace enabled or disabled.
  67. *
  68. * @param message the detail message.
  69. * @param cause the cause. (A {@code null} value is permitted,
  70. * and indicates that the cause is nonexistent or unknown.)
  71. * @param enableSuppression whether or not suppression is enabled
  72. * or disabled
  73. * @param writableStackTrace whether or not the stack trace should
  74. * be writable
  75. * @since 1.7
  76. */
  77. public UsernameDuplicateException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
  78. super(message, cause, enableSuppression, writableStackTrace);
  79. }
  80. }