added methods for getting Boolean, String, Double and int

This commit is contained in:
Fleischer Hanno
2024-12-02 20:34:52 +01:00
parent 1918aa80ff
commit 73859d8c81

View File

@@ -22,10 +22,22 @@ public class Resources {
* @throws java.util.MissingResourceException if no object for the given key can be found
* @throws ClassCastException if the object found for the given key is not a string
*/
public static String lookup(String key) {
public static String stringLookup(String key) {
return BUNDLE.getString(key);
}
public static int intLookup(String key) {
return Integer.parseInt(BUNDLE.getString(key));
}
public static boolean boolLookup(String key) {
return Boolean.parseBoolean(BUNDLE.getString(key));
}
public static double doubleLookup(String key) {
return Double.parseDouble(BUNDLE.getString(key));
}
/**
* Private constructor to prevent instantiation.
*/