This message was deleted.
# community-support
s
This message was deleted.
z
actually, found;
Copy code
val collection: DomainObjectCollection<MyClass> = objects.domainObjectSet(MyClass::class)
but I would still like to find a way to provide a custom “namer”
t
out of curiosity, why are you opposed to making a change to support this use-case?
z
I don’t want to couple
MyClass
to gradle API specific code. For the same effective reason extension functions are useful over instance functions
t
not to be difficult, but it's just unclear why you'd want a gradle-collection of something that wasn't already gradle-specific. Is
MyClass
also used for other build systems?
that said, I think you can just have a
name
property without implementing
Named
. So long as your class isn't
final
, Gradle will extend it at runtime
z
Tbh there’s no killer reason. Just want to have a clean separation of concerns. My new code to leverage
DomainNamedObjectCollection<MyClass>
is in one place - having to modify
MyClass
to support it is a bit messy
g
If you want such separation and class is not final you can just create subclass implementing
Named
and create named collection of these.