BeanBuilder.build is a utils to build a target case-class instance from other case-class instance.
BeanBuilder.build is a utils to build a target case-class instance from other case-class instance.
It follows the simple name-to-name field copy, if the default copy not works for you, you may define custom copies in the adds arguament.
BeanBuilder support copy field via 1. direct assignment. such as dest.field = src.field 2. using implicit convert. such as dest.field = implicit_func( src.field ) 3. for box types, call map. such as dest.field = src.field.map( implicit_func ) 4. looking for a implict method copyto, such as dest.field = src.field.copyTo[T] 5. otherwise, try dest.field = BeanBuilder.build[T](src)
the taregt bean
such as "name" -> name etc
TODO support camel and underscore name mapping like doSomething <-> do_something