Skip to content

Commit

Permalink
Update settings API
Browse files Browse the repository at this point in the history
Signed-off-by: Otavio Santana <otaviopolianasantana@gmail.com>
  • Loading branch information
otaviojava committed Nov 8, 2022
1 parent 447a77e commit a42a255
Showing 1 changed file with 19 additions and 0 deletions.
Expand Up @@ -219,6 +219,15 @@ public interface Settings {
*/
void computeIfPresent(String key, BiConsumer<String, Object> action);

/**
* If the value for the specified key is present and non-null, attempts to compute a new mapping given the key and its current mapped value.
*
* @param supplier the key
* @param action the action
* @throws NullPointerException when there is null parameter
*/
void computeIfPresent(Supplier<String> supplier, BiConsumer<String, Object> action);

/**
* If the specified key is not already associated with a value (or is mapped to null),
* attempts to compute its value using the given mapping function and enters it into this map unless null.
Expand All @@ -229,6 +238,16 @@ public interface Settings {
*/
void computeIfAbsent(String key, Function<String, Object> action);

/**
* If the specified key is not already associated with a value (or is mapped to null),
* attempts to compute its value using the given mapping function and enters it into this map unless null.
*
* @param supplier the supplier
* @param action the action
* @throws NullPointerException when there is null parameter
*/
void computeIfAbsent(Supplier<String> supplier, Function<String, Object> action);

/**
* Creates a {@link SettingsBuilder}
*
Expand Down

0 comments on commit a42a255

Please sign in to comment.