gradle / gradle

Adaptable, fast automation for all
https://gradle.org
Apache License 2.0
16.98k stars 4.76k forks source link

ObjectFactory map/list with nested generics #31349

Open xenoterracide opened 4 days ago

xenoterracide commented 4 days ago

Expected Behavior

Say I want Property<Map<String, Foo<Bar>>>, this currently isn't easy with the API. Perhaps a better way would be to allow TypeOf, or some cartesian product of TypeOf/Class although I think for Map TypeOf, TypeOf would probably be fine since you could just do

    Property<Map<String, Foo<Bar>>> fooBarMapProp  = project.getObjects().mapProperty(new TypeOf<String>() {}, new TypeOf<Foo<Bar>>())

Current Behavior (optional)

No response

Context

I have a case where I want, or at least think I want to return a map that has values that have generics.

ljacomet commented 3 days ago

This feature request is in the backlog of the relevant team and is prioritized by them.