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

GetAt via annotation #267

Open
pauxus opened this issue Apr 2, 2023 · 1 comment
Open

GetAt via annotation #267

pauxus opened this issue Apr 2, 2023 · 1 comment
Labels
enhancement LHF Low hanging fruit

Comments

@pauxus
Copy link
Member

pauxus commented Apr 2, 2023

Provide an annotation for the "main" children of a model class. The main children must be a map which can be directly accessed via getAt ([]) or properties access:

@DSL class Home {
  @DirectChildren
  Map<String, Room> rooms
}

should allow a syntax like

home['Living-Room']
home.LivingRoom
@pauxus pauxus added enhancement LHF Low hanging fruit labels Apr 2, 2023
@pauxus
Copy link
Member Author

pauxus commented Apr 3, 2023

This could even extend to unbounded collection factory methods:

home {
  livingRoom {...}
}

where any unknown method calls on an RW instance are directed to factory methods of the DirectChildren collection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement LHF Low hanging fruit
Projects
None yet
Development

No branches or pull requests

1 participant