TextConversionException.java

  1. package com.github.mygreen.splate.type;

  2. import com.github.mygreen.splate.TwoWaySqlException;

  3. import lombok.Getter;


  4. /**
  5.  * 値を文字列への変換に失敗したときにスローされます。
  6.  *
  7.  * @author T.TSUCHIE
  8.  *
  9.  */
  10. public class TextConversionException extends TwoWaySqlException {

  11.     /**
  12.      * 変換対象の値
  13.      */
  14.     @Getter
  15.     private final Object targetValue;

  16.     /**
  17.      * メッセージを指定してインスタンスと作成します。
  18.      * @param targetValue 変換対象の値
  19.      * @param message メッセージ
  20.      */
  21.     public TextConversionException(Object targetValue, String message) {
  22.         super(message);
  23.         this.targetValue = targetValue;
  24.     }

  25.     /**
  26.      * メッセージと例外を指定してインスタンスを作成します。
  27.      * @param targetValue 変換対象の値
  28.      * @param message メッセージ
  29.      * @param cause 原因となる例外
  30.      */
  31.     public TextConversionException(Object targetValue, String message, Throwable cause) {
  32.         super(message, cause);
  33.         this.targetValue = targetValue;
  34.     }
  35. }