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 findFirst utility method #26

Open
x7airworker opened this issue Apr 20, 2023 · 1 comment
Open

Add findFirst utility method #26

x7airworker opened this issue Apr 20, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@x7airworker
Copy link
Member

Is your feature request related to a problem? Please describe.
When you want to find a value just by the key, but don't care about the structure, you most likely write a recursive method to do that for you. So I think it would be good to include this utility method into the project.

Describe the solution you'd like
Basically a recursive method for both AbstractObject and AbstractArray.
AbstractElement findFirst(String key)
The method should be on AbstractArray as well, because an AbstractArray could contain objects which contain the key I want to search for.

@x7airworker x7airworker added the enhancement New feature or request label Apr 20, 2023
@JanHolger
Copy link
Member

This could be implemented as an extension to the query method, maybe by adding a wildcard placeholder to it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants