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
Implement NodeWalker utility for traversing configuration structures #103
Conversation
64b6f5e
to
c5b2393
Compare
can you make the node walker abstract class instead? |
What would be the benefit? |
I'd rather see a class like: public abstract class NodeWalker {
public static final NodeWalker BREADTH_FIRST = // ...
// ... |
|
Using an |
I don't foresee anyone doing this - but sure, point taken - will change. Are you happy with the name |
|
Hm yea, I think I prefer the first one |
Okay, changed to |
Provides a way to easily iterate over an entire configuration structure, or visit the child nodes in a specific sub section.
Use cases:
I also intend to use this in SpongeCommon & GriefPrevention to exclude entries from being saved if they're already present & set to the same value in a "parent" config. Some sort of DFS post order traversal is needed to implement this behaviour, and I figured it made sense for that code to be in configurate itself, as opposed to being implemented in sub-projects.
Would appreciate any feedback :)