Generating hashCode() and equals() when creating Java classes using Mojo Jaxb2 maven plugin

前端 未结 7 1741
逝去的感伤
逝去的感伤 2020-12-03 15:18

The code I\'m working on is using jaxb2-maven-plugin from org.codehaus.mojo to generate Java classes from XSD schema. I\'m looking for a way to aut

7条回答
  •  悲哀的现实
    2020-12-03 15:58

    There is also a fluent-builder plugin for JAXB that doesn't necessarily generate dependencies to third-party code. Plus, it is a true "Builder" design pattern, whereas the "fluent-api" plugin just adds builder-like methods to the generated classes. It is: https://github.com/mklemm/jaxb2-rich-contract-plugin It also has options to make the generated classes immutable and it can generate methods to copy the state of existing objects into a new builder instance, also supporting "partial" object copy.

提交回复
热议问题