3 import java.util.ResourceBundle;
6 * The helper class for reading configuration from .properties file.
10 private final ResourceBundle bundle;
13 * Creates instance of Config which reads configuration data form
14 * .properties file with given name found in classpath.
16 * @param name the name of the .properties file
18 public Config(final String name) {
19 this.bundle = ResourceBundle.getBundle(name);
23 * Returns the value as String for the given key.
25 * @param key the property's key
26 * @return String value of the property
28 public String getString(final String key) {
29 return this.bundle.getString(key);
33 * Returns the value as int for the given key.
35 * @param key the property's key
36 * @return int value of the property
38 public int getInt(final String key) {
39 return Integer.parseInt(getString(key));