David Leangen created FELIX-5561:
------------------------------------

             Summary: Support for merging?
                 Key: FELIX-5561
                 URL: https://issues.apache.org/jira/browse/FELIX-5561
             Project: Felix
          Issue Type: Wish
          Components: Converter
            Reporter: David Leangen


Would it be reasonable for the Converter to support a "merge" operation? Or is 
that just too far out of scope.

Example - merging a partial map into an existing object:

Object o2 = converter.merge( m ).into( o1 ).

Example of "complex" chaining operation - merging two maps, and converting to 
object:

Object o2 = converter.merge( m1 ).into( m2 ).to( Object.class );

Just thinking hypothetically for now.

I can imagine cases where partial updates need to be applied. For instance, if 
a "Contact" object exists, and we only want to update one or two fields, the 
Converter could assist:

Contact updated = converter.merge( "{name:'Joe Smith', nickname:'joey'} ).into( 
contact );

If this is too far out of scope, I'll drop it here. Otherwise, I'll play around 
with it a bit and let you know how that goes.

wdyt?



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to