Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add KiwiMaps method to to check a map contains a key with non-null value #1093

Closed
sleberknight opened this issue Jan 7, 2024 · 0 comments · Fixed by #1096
Closed

Add KiwiMaps method to to check a map contains a key with non-null value #1093

sleberknight opened this issue Jan 7, 2024 · 0 comments · Fixed by #1096
Assignees
Labels
new feature A new feature such as a new class, method, package, group of classes, etc.
Milestone

Comments

@sleberknight
Copy link
Member

sleberknight commented Jan 7, 2024

Sometimes, for example during input or argument validation, you want to make sure a Map contains a key which has a non-null value. Add a new method to KiwiMaps:

public static <K, V> boolean keyExistsWithNonNullValue(Map<K, V> map, K key)

This complements the existing keyExistsWithNullValue method which checks whether map contains a key which has a null value.

@sleberknight sleberknight added the new feature A new feature such as a new class, method, package, group of classes, etc. label Jan 7, 2024
@sleberknight sleberknight added this to the 3.2.1 milestone Jan 7, 2024
@sleberknight sleberknight self-assigned this Jan 7, 2024
sleberknight added a commit that referenced this issue Jan 7, 2024
This method checks whether a Map contains a key whose
associated value is null.

Closes #1093
sleberknight added a commit that referenced this issue Jan 7, 2024
This method checks whether a Map contains a key whose
associated value is null.

Closes #1093
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature A new feature such as a new class, method, package, group of classes, etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant