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 @Ordered validator #21

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

Add @Ordered validator #21

jossmoff opened this issue Jul 3, 2023 · 0 comments
Assignees
Labels
✨ enhancement New feature or request 👋 help wanted Extra attention is needed 🗂️ list Validation related to Lists
Milestone

Comments

@jossmoff
Copy link
Owner

jossmoff commented Jul 3, 2023

Search before asking

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

Description

There are very few annotations for list. A common property that you might want to validate is that the List is sorted according to the natural ordering.

Solution

  1. Use the custom generation script to generate base classes for @Ordered
  2. Implement the validation using something similar too:
return list.stream()
                .sorted()
                .collect(Collectors.toList())
                .equals(list);

Are you willing to submit PR?

  • Yes I am willing to submit a PR!
@jossmoff jossmoff added ✨ enhancement New feature or request 👋 help wanted Extra attention is needed 🗂️ list Validation related to Lists labels Jul 3, 2023
@jossmoff jossmoff added this to the Version 1.0.0 milestone Jul 3, 2023
@jossmoff jossmoff self-assigned this Jul 3, 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 👋 help wanted Extra attention is needed 🗂️ list Validation related to Lists
Projects
None yet
Development

No branches or pull requests

1 participant