diff options
Diffstat (limited to 'id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/Configuration.java')
-rw-r--r-- | id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/Configuration.java | 45 |
1 files changed, 22 insertions, 23 deletions
diff --git a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/Configuration.java b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/Configuration.java index 43f7d9454..873208aaf 100644 --- a/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/Configuration.java +++ b/id/server/moa-id-commons/src/main/java/com/datentechnik/moa/id/conf/persistence/Configuration.java @@ -3,53 +3,52 @@ package com.datentechnik.moa.id.conf.persistence; import java.util.List; /** - * + * An interface for a key-value configuration. */ public interface Configuration { /** - * - * @param key - * @return + * Get the value associated with the given key as {@link Object}. + * @param key the key + * @return the object associated with the given key or {@code null} if the key does not exist or does not have a value. */ Object get(String key); /** + * Get the object of type {@code T} associated with the given key. * - * @param key - * @param clazz - * @return + * @param key the key + * @param clazz the type of the requested object + * @return the object associated with the given key or {@code null} if the key does not exist or does not have a value. */ <T> T get(String key, Class<T> clazz); /** + * Store an object associated with a key. If the given object is set to {@code null} then the entry associated with the key is deleted. * - * @param key - * @param value + * @param key the key under which the value is stored, respectively key determining the entry to be deleted. + * @param value the object to store. if value is set to {@code null} then the entry associated with key {@code key} is deleted. + * @return {@code true} if the operation was carried out successfully, {@code false} otherwise. */ boolean set(String key, Object value); /** + * Get the object of type {@code T} associated with the given key from the database. If the key does not exist or does not have a value, the given default + * value is returned. * - * @param key - * @param clazz - * @param defaultValue - * @return + * @param key the key + * @param clazz the type of the requested object + * @param defaultValue the default value to return + * @return the object associated with the given key or {@code defaultValue} if the key does not exist or does not have a value. */ <T> T get(String key, Class<T> clazz, Object defaultValue); /** - * - * @param key - * @param clazz - * @return + * Get a list of objects associated with the given key. The list may be empty or contain only a single object. + * @param key the key + * @param clazz the type of the requested object + * @return a list containing objects of type {@code T} or an empty list if no objects are associated with the key. */ <T> List<T> getList(String key, Class<T> clazz); - /** - * - * @param key - * @return - */ - void delete(String key); }
\ No newline at end of file |