mirror of
https://github.com/DerTyp7/lf05-java.git
synced 2025-10-30 21:07:12 +01:00
nogard oder so
This commit is contained in:
20
src/nogard/schritt5/GegenstandNichtVorhandenException.java
Normal file
20
src/nogard/schritt5/GegenstandNichtVorhandenException.java
Normal file
@@ -0,0 +1,20 @@
|
||||
package nogard.schritt5;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user