[New] Added I18nMessage property to StrolchException

This commit is contained in:
Robert von Burg 2021-04-22 16:33:32 +02:00
parent b3d2501e5b
commit 523d1372c1
1 changed files with 21 additions and 7 deletions

View File

@ -15,23 +15,37 @@
*/
package li.strolch.exception;
import li.strolch.utils.I18nMessage;
/**
* @author Robert von Burg <eitch@eitchnet.ch>
*/
public class StrolchException extends RuntimeException {
/**
* @param message
* @param cause
*/
private I18nMessage i18n;
public StrolchException(String message, Throwable cause) {
super(message, cause);
}
/**
* @param message
*/
public StrolchException(String message) {
super(message);
}
public boolean hasI18n() {
return this.i18n != null;
}
public I18nMessage getI18n() {
return this.i18n;
}
public void setI18n(I18nMessage i18n) {
this.i18n = i18n;
}
public StrolchException i18n(I18nMessage i18n) {
this.i18n = i18n;
return this;
}
}