implement containsKey
ci/woodpecker/push/woodpecker Pipeline was successful Details

This commit is contained in:
Johannes Frohnmeyer 2023-04-04 18:07:26 +02:00
parent 1dbc6b549b
commit 3ff582c780
Signed by: Johannes
GPG Key ID: E76429612C2929F4
1 changed files with 7 additions and 0 deletions

View File

@ -56,6 +56,13 @@ public class String2ObjectMap<V> extends AbstractMap<String, V> implements Seria
return null;
}
@Override
public boolean containsKey(Object key) {
if (!(key instanceof CharSequence seq)) return false;
SearchResult<V> searchResult = searchTree(seq);
return searchResult.classification.equals(Classification.EXACT_MATCH);
}
public Iterable<CharSequence> getKeysStartingWith(CharSequence prefix) {
return getForKeysStartingWith(prefix, this::getDescendantKeys, Collections::emptySet);
}