klum-dsl / klum-ast

Turn your models into super models
https://github.com/klum-dsl/klum-ast/wiki
MIT License
3 stars 0 forks source link

Custom Creator methods should also support Collection results #319

Closed pauxus closed 6 months ago

pauxus commented 6 months ago

For inclusion in the collection factory, something like

MyApplication.Create.With {
  services {
    fromFolder(myFolder)
  }
}

Where the folder might contain a number of scripts or properties files to create the instances. The method of the Factory class of Service would return Collection in this case:

Collection<Service> fromFolder(File folder) {
  folder.listFiles().collect { From(it) }
}
pauxus commented 6 months ago

This should also be possible for default factory methods