mapstruct
正在学习: mapstruct
澄清本质
学习的本质是使得大脑的突触建立更有力的连接。学习后,当有信息输入大脑时,能产出正确的输出。
如当遇到需求、bug、问题时,能清楚地知道这是不是 xxx 的问题,以及能否通过 xxx 解决
Learn by do、teach、create
目标
让 mapstruct 支持复杂 proto 对象间的转化,并且不影响旧的转化
提出问题 & 收集信息
文档 https://mapstruct.org/documentation/stable/reference/html/
源码 https://github.com/mapstruct/mapstruct
示例 https://github.com/mapstruct/mapstruct-examples
mapstruct 是什么?
MapStruct is a Java annotation processor for the generation of type-safe bean mapping classes.
The general philosophy of MapStruct is to generate code which looks as much as possible as if you had written it yourself from hand. In particular this means that the values are copied from source to target by plain getter/setter invocations instead of reflection or similar.
JavaBean 是什么?
A JavaBean is just a "http://www.oracle.com/technetwork/java/javase/documentation/spec-136004.html">standard
- All properties are private (use getters/setters)
- A public no-argument constructor
- Implements "text-decoration: underline;">Serializable.