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 isIn and isNotIn on Map validation #45

Open
knmsk opened this issue Jul 2, 2020 · 0 comments · May be fixed by #46
Open

Add isIn and isNotIn on Map validation #45

knmsk opened this issue Jul 2, 2020 · 0 comments · May be fixed by #46

Comments

@knmsk
Copy link

knmsk commented Jul 2, 2020

Is your feature request related to a problem? Please describe.

I'm trying to use this feature to validate if the map keys contains all my parameters list of keys to evaluate.

Describe the solution you'd like

val metadata: Map<String, String> = mapOf()
validate(metadata).isInKeys("key1", "key2")
validate(metadata).isInKeys(listOf("key1", "key2"))
validate(metadata).isInKeys(setOf("key1", "key2"))
validate(metadata).isNotInKeys("key1", "key2")
validate(metadata).isNotInKeys(listOf("key1", "key2"))
validate(metadata).isInValues("value1", "value2")
validate(metadata).isInValues(listOf("value1", "value2"))
validate(metadata).isInValues(setOf("value1", "value2"))
validate(metadata).isNotInValues(listOf("value1", "value2"))
validate(metadata).isNotInValues("value1", "value2")

Describe alternatives you've considered

Create a extension function to use for myself, using doesNotContainsAllKeys or doesNotContainsAllKeys

Additional context

N/A

@knmsk knmsk linked a pull request Jul 2, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant