|
32 | 32 | * |
33 | 33 | */ |
34 | 34 | public interface Configuration { |
| 35 | + /** @param propertyName the property name |
| 36 | + * @return the property value, or an empty string if not found |
| 37 | + */ |
35 | 38 | String get(String propertyName); |
36 | 39 | /** |
37 | | - * @param propertyName ditto |
38 | | - * @return all properties with a given name (or a zero-length array) |
| 40 | + * Returns all property values with the given name. |
| 41 | + * @param propertyName the property name |
| 42 | + * @return all matching values, or a zero-length array |
39 | 43 | */ |
40 | 44 | String[] getAll(String propertyName); |
| 45 | + /** @param propertyName the property name @return all values as int array */ |
41 | 46 | int[] getInts(String propertyName); |
| 47 | + /** @param propertyName the property name @return all values as long array */ |
42 | 48 | long[] getLongs(String propertyName); |
| 49 | + /** @param propertyName the property name @return all values as double array */ |
43 | 50 | double[] getDoubles(String propertyName); |
| 51 | + /** @param propertyName the property name @return all values as boolean array */ |
44 | 52 | boolean[] getBooleans(String propertyName); |
| 53 | + /** @param propertyName the property name @param defaultValue value to return if not found @return the value or defaultValue */ |
45 | 54 | String get(String propertyName, String defaultValue); |
| 55 | + /** @param propertyName the property name @return the value as an int, or 0 if not found */ |
46 | 56 | int getInt(String propertyName); |
| 57 | + /** @param propertyName the property name @param defaultValue default if not found @return the value as int */ |
47 | 58 | int getInt(String propertyName, int defaultValue); |
| 59 | + /** @param propertyName the property name @return the value as a long, or 0 if not found */ |
48 | 60 | long getLong(String propertyName); |
| 61 | + /** @param propertyName the property name @param defaultValue default if not found @return the value as long */ |
49 | 62 | long getLong(String propertyName, long defaultValue); |
| 63 | + /** @param propertyName the property name @return the value as a double, or 0.0 if not found */ |
50 | 64 | double getDouble(String propertyName); |
| 65 | + /** @param propertyName the property name @param defaultValue default if not found @return the value as double */ |
51 | 66 | double getDouble(String propertyName, double defaultValue); |
| 67 | + /** @param propertyName the property name @return the value as a boolean, or false if not found */ |
52 | 68 | boolean getBoolean(String propertyName); |
| 69 | + /** @param propertyName the property name @param defaultValue default if not found @return the value as boolean */ |
53 | 70 | boolean getBoolean(String propertyName, boolean defaultValue); |
54 | 71 | /** |
55 | | - * @param name the Property name |
56 | | - * @param value typically a String, but could be a String[] too |
| 72 | + * Stores a property value. |
| 73 | + * @param name the property name |
| 74 | + * @param value the value (typically a String or String[]) |
57 | 75 | */ |
58 | 76 | void put(String name, Object value); |
| 77 | + /** @return the set of all property names in this configuration */ |
59 | 78 | Set<String> keySet(); |
60 | 79 | } |
0 commit comments