Skip to content

Commit

Permalink
Add KeyValue.of() variants for none values
Browse files Browse the repository at this point in the history
  • Loading branch information
izeye committed Oct 18, 2022
1 parent 320b38f commit 1a12ce7
Showing 1 changed file with 18 additions and 0 deletions.
Expand Up @@ -57,6 +57,24 @@ static KeyValue of(KeyName keyName, String value) {
return KeyValue.of(keyName.asString(), value);
}

/**
* Creates a {@link KeyValue} for the given key and {@value NONE_VALUE}.
* @param key key of the KeyValue
* @return KeyValue
*/
static KeyValue of(String key) {
return of(key, NONE_VALUE);
}

/**
* Creates a {@link KeyValue} for the given {@link KeyName} and {@value NONE_VALUE}.
* @param keyName name of the key of the KeyValue
* @return KeyValue
*/
static KeyValue of(KeyName keyName) {
return of(keyName, NONE_VALUE);
}

/**
* Creates a {@link KeyValue} for the given key and value and additionally validates
* it with the {@link Predicate}.
Expand Down

0 comments on commit 1a12ce7

Please sign in to comment.