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

validation by number of matches for list #55

Open
rmpt opened this issue Nov 25, 2020 · 0 comments
Open

validation by number of matches for list #55

rmpt opened this issue Nov 25, 2020 · 0 comments

Comments

@rmpt
Copy link

rmpt commented Nov 25, 2020

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

I have a list of abstract instances and I want to validate the exactly 1 and only a element is of subtype X.

Describe the solution you'd like

To validate 1 match, I have to do something like:

validate(SomeEntity::myList)
    .validate { it.single { listItem -> listItem is MySpecificSubClass } }

For N matches I would have to add a counter or something.

Describe alternatives you've considered

I have to keep like an external counter or so.

Additional context

No additional data

@rmpt rmpt changed the title single validaiton for list validaiton by number of matches for list Nov 25, 2020
@rmpt rmpt changed the title validaiton by number of matches for list validation by number of matches for list Nov 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant