All posts in Trimm Java

Ever had to do copy/clone methods in large objects?

Doing it by hand takes a long time, it’s a nightmare to maintain and can lead to some serious bugs.
You could always use some kind of serialization like Java Object Serialization java.io.ObjectInputStream and java.io.ObjectOutputStream, to do it.

But there is and easier way, you can now use Trimm to automatically create a copy method in all your pojos, just use dk.tigerteam.trimm.mdsd.java.generator.extension.CopyMethodEventListener in your yaml configuration like:

# Extensions (note these listeners can also be groovy scripts containing a single class implement the GeneratorEventListener interface (or
# which extend specializations thereof) 
eventListeners:
    - listener: dk.tigerteam.trimm.mdsd.java.generator.extension.CopyMethodEventListener
    - listener: dk.tigerteam.trimm.mdsd.java.generator.extension.SerialVersionUIDGeneratorListener
    - listener: dk.tigerteam.trimm.mdsd.java.generator.extension.PropertySugarMethodsEventListener
    - listener: dk.tigerteam.trimm.mdsd.java.generator.extension.ToStringListener
    - listener: dk.tigerteam.trimm.mdsd.java.generator.extension.HashCodeAndEqualsListener

Read more