Package com.yahoo.component.provider
Interface Freezable
-
- All Known Subinterfaces:
ListenableFreezable
- All Known Implementing Classes:
FreezableClass
,FreezableComponent
,FreezableSimpleComponent
,ListenableFreezableClass
public interface Freezable
A class which may be irreversibly frozen. Any attempt to change the state of this class after freezing throws an IllegalStateException.- Author:
- bratseth
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
freeze()
Freezes this component to prevent further changes.boolean
isFrozen()
Inspect whether this object can be changed.
-
-
-
Method Detail
-
freeze
void freeze()
Freezes this component to prevent further changes. Override this to freeze internal data structures and dependent objects. Overrides must call super. Calling freeze on an already frozen class must have no effect.
-
isFrozen
boolean isFrozen()
Inspect whether this object can be changed. If the object is immutable from construction, this should return true, even if freeze() never has been invoked.- Returns:
- true if this instance is in an immutable state, false otherwise
- Since:
- 5.1.4
-
-