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 @Superset and @Subset annotations #24

Open
1 of 2 tasks
jossmoff opened this issue Jul 5, 2023 · 0 comments
Open
1 of 2 tasks

Add @Superset and @Subset annotations #24

jossmoff opened this issue Jul 5, 2023 · 0 comments
Labels
✨ enhancement New feature or request 🗂️ list Validation related to Lists

Comments

@jossmoff
Copy link
Owner

jossmoff commented Jul 5, 2023

Search before asking

  • I had searched in the issues and found no similar issues.

Description

It's a common check to validate that we have some a collection that is either a subset or superset of some other collection.

Solution

We can use Set.containsAll(Collection <?> C) (docs) to do this check. We will convert the collection to a list for superset by using the following:

list.stream().collect(Collectors.toSet());

Are you willing to submit PR?

  • Yes I am willing to submit a PR!
@jossmoff jossmoff added 🗂️ list Validation related to Lists ✨ enhancement New feature or request labels Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ enhancement New feature or request 🗂️ list Validation related to Lists
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant