enhancement
major
minor
major
minor
major
#26739
WrapperGenerator: Typed factory methods and addXxx(), removeXxx()
There is no way to create an object in Java code in a type-safe manner. Incremental addition to and removal from Collections is not supported by the typed classes.
Improvement
The generated factory receives the methods ` createMyType() ` and `createMyType(TLObject context) `, regardless of whether the type is structured or not.
For a multiple-reference `things `, additional methods ` addThing(Thing newValue) ` and ` removeThing(Thing oldValue) ` are generated.
A Set<T> getMyRefModifiable() is also generated for unordered multi-references.
Code Migration
The newMyType() method for unstructured types is no longer used. Instead, the createMyType() method must be used.
The generic factory method `Object createObject(Object context, TLClass type, ValueProvider initialValues);` is no longer used; instead, the existing method ` TLObject createObject(TLClass type, TLObject context, ValueProvider initialValues) ` must be used.
Test
test.com.top_logic.element.model.generate.TestWrapperGenerator