mirror of
https://github.com/DerTyp7/lf05-java.git
synced 2025-10-29 20:42:11 +01:00
23 lines
577 B
Java
23 lines
577 B
Java
package nogard.schritt6.exceptions;
|
|
|
|
import nogard.schritt6b.Gegenstand;
|
|
|
|
public class GegenstandNichtVorhandenException extends Exception {
|
|
private final String text;
|
|
public GegenstandNichtVorhandenException(Gegenstand g) {
|
|
StringBuilder sb = new StringBuilder();
|
|
sb.append(g.getInfo());
|
|
sb.append("Ist nicht in dem Bereich vorhanden.");
|
|
text = sb.toString();
|
|
}
|
|
|
|
public GegenstandNichtVorhandenException(String text) {
|
|
this.text = text;
|
|
}
|
|
|
|
@Override
|
|
public String getMessage() {
|
|
return text;
|
|
}
|
|
}
|