classlib: add TResourceBundle.containsKey (#779)

Fix #573
This commit is contained in:
Jörg Hohwiller 2023-10-08 11:41:55 +02:00 committed by GitHub
parent 3d65d38375
commit 7e761ca7e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -138,6 +138,18 @@ public abstract class TResourceBundle {
throw new MissingResourceException("", last.getClass().getName(), key);
}
public boolean containsKey(String key) {
TResourceBundle theParent = this;
do {
Object result = theParent.handleGetObject(key);
if (result != null) {
return true;
}
theParent = theParent.parent;
} while (theParent != null);
return false;
}
public final String getString(String key) {
return (String) getObject(key);
}