From ebb9f839c7bc76a245bb83605d890828e3ad8fc9 Mon Sep 17 00:00:00 2001 From: Fleischer Hanno Date: Mon, 2 Dec 2024 20:58:00 +0100 Subject: [PATCH] added JavaDocs in Resources.java --- .../src/main/java/pp/mdga/Resources.java | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/Resources.java b/Projekte/mdga/model/src/main/java/pp/mdga/Resources.java index f721043d..13a60c48 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/Resources.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/Resources.java @@ -32,14 +32,41 @@ public static String stringLookup(String key) { return BUNDLE.getString(key); } + /** + * Gets a int for the given key from the resource bundle in {@linkplain #BUNDLE}. + * + * @param key the key for the desired string + * @return the string for the given key + * @throws NullPointerException if {@code key} is {@code null} + * @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 int intLookup(String key) { return Integer.parseInt(BUNDLE.getString(key)); } + /** + * Gets a boolean for the given key from the resource bundle in {@linkplain #BUNDLE}. + * + * @param key the key for the desired string + * @return the string for the given key + * @throws NullPointerException if {@code key} is {@code null} + * @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 boolean boolLookup(String key) { return Boolean.parseBoolean(BUNDLE.getString(key)); } + /** + * Gets a double for the given key from the resource bundle in {@linkplain #BUNDLE}. + * + * @param key the key for the desired string + * @return the string for the given key + * @throws NullPointerException if {@code key} is {@code null} + * @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 double doubleLookup(String key) { return Double.parseDouble(BUNDLE.getString(key)); }