public interface Freezable
A freezable object.
Some classes are value objects by nature, but are not immutable, for example Date.
Whenever the use case requires immutability, such objects cannot be used safely.
That's why Tentackle provides extended implementations of those types, that can be made immutable.
Once an object is frozen, it cannot be unfrozen anymore. However, its clones are unfrozen (if cloneable).
Any attempt to modify a frozen object results in a TentackleRuntimeException.
-
Method Summary
-
Method Details
-
freeze
void freeze()Makes this object immutable. -
freeze
Freezes a value object null-safe.
Method provided to reduce generated code.- Parameters:
freezable- the value object to freeze, may be null
-