Files
lf05-java/src/nogard/schritt6/exceptions/GegenstandNichtVorhandenException.java
Janis M aa89da7ce9 6
2022-05-02 11:58:32 +02:00

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;
}
}