kostaskougios / cloning

deep clone java objects
Other
591 stars 112 forks source link

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

Closed eladh closed 7 years ago

eladh commented 7 years ago

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

kostaskougios commented 7 years ago

Hi, I've uploaded a snapshot at https://oss.sonatype.org/content/repositories/snapshots/uk/com/robust-it/cloning/1.9.8-SNAPSHOT/

Please let me know if it is OK.

kostaskougios commented 7 years ago

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

eladh commented 7 years ago

10x :-)