Ticket #57 (new enhancement)

Opened 3 years ago

Add freeze() and / or toFrozen() to the value type code generator

Reported by: amandel Owned by: amandel
Priority: major Milestone: unscheduled
Component: code-generators Version: trunk
Keywords: Cc:

Description

I picked this up at Java Posse.

We could add these two methods to the generated value objects. toFrozen() could return a copy of the current value object that is immutable, freze() would change the state of the value object to be immutable (all setters would throw a UnsupportedOperationException?).

There are several things to be sorted out before (like how to deal with object trees etc.)

The 'mutable' version of the class could be called *Builder, how to call the common interface? How to call the immutable version?

Note: See TracTickets for help on using tickets.