tree-ware / tree-ware-kotlin-core

Apache License 2.0
1 stars 0 forks source link

Add a method for merging a new entity with an existing matching entity in a composition set #128

Closed deepak-nulu closed 2 years ago

deepak-nulu commented 2 years ago

When a new entity is added to a collection set using the MutableSetFieldModel::addValue() method, any existing matching entity in the set gets replaced. Add a mergeValue() method that merges the new entity fields into the existing match entity in the set. If the same field exists in both, the new entity's fields take precedence. If there is no matching entity, then the new entity gets added to the set. The method should return true if there was a matching entity, else it should return false.