kostaskougios/cloning

Support Cloning strategy based on object field and not just object class

Closed this issue · 3 comments

eladh commented

Hi @kostaskougios :-)

we got more a scenario were cloning strategy will be decided based on the the field context and not just the class itself

looking at the code : cloneObject got the field context can you also add the field data to the cloneInternal and exposed it as part of the Cloning strategy infrastructure

like this:

 cloner.registerCloningStrategy((field ,toBeCloned )  -> {
           return ICloningStrategy.Strategy.IGNORE;
        });

best,
elad

Btw notice the IGNORE strategy will ignore the strategy and return a deep clone as if the strategy wasn't present.

eladh commented

10x :-)