mirror of
https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
synced 2025-08-06 15:30:28 +02:00
41 lines
1.2 KiB
Java
41 lines
1.2 KiB
Java
////////////////////////////////////////
|
|
// Programming project code
|
|
// UniBw M, 2022, 2023, 2024
|
|
// www.unibw.de/inf2
|
|
// (c) Mark Minas (mark.minas@unibw.de)
|
|
////////////////////////////////////////
|
|
|
|
package pp.monopoly;
|
|
|
|
import java.util.ResourceBundle;
|
|
|
|
/**
|
|
* Provides access to the resource bundle of the game.
|
|
*
|
|
* @see #BUNDLE
|
|
*/
|
|
public class Resources {
|
|
/**
|
|
* The resource bundle for the Monopoly game.
|
|
*/
|
|
public static final ResourceBundle BUNDLE = ResourceBundle.getBundle("monopoly"); //NON-NLS
|
|
|
|
/**
|
|
* Gets a string 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 String lookup(String key) {
|
|
return BUNDLE.getString(key);
|
|
}
|
|
|
|
/**
|
|
* Private constructor to prevent instantiation.
|
|
*/
|
|
private Resources() { /* do not instantiate */ }
|
|
}
|