public interface Freezable
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.
Any attempt to modify a frozen object results in a TentackleRuntimeException.
| Modifier and Type | Method and Description |
|---|---|
void |
freeze()
Makes this object immutable.
|
static void |
freeze(Freezable freezable)
Freezes a value object null-safe.
Method provided to reduce generated code. |
void freeze()
static void freeze(Freezable freezable)
freezable - the value object to freeze, may be nullTentackle - distributed, domain- and model-driven