public abstract class AbstractLockable<T extends AbstractLockable<T>>
extends java.lang.Object
lock()
method can return the
"this" reference.Modifier and Type | Field and Description |
---|---|
private boolean |
locked |
private boolean |
valid |
Modifier | Constructor and Description |
---|---|
protected |
AbstractLockable() |
Modifier and Type | Method and Description |
---|---|
protected void |
checkLocked(java.lang.String method)
Check the locked status and throw an
IllegalStateException
if this instance has been locked. |
protected void |
checkValid(boolean forLock)
Check if the configuration settings are valid.
|
boolean |
isLocked()
Is this instance locked for modifications?
|
boolean |
isValid()
Check if this configuration is valid or not.
|
T |
lock()
Lock this instance for future modifications.
|
public final boolean isValid()
protected void checkValid(boolean forLock)
forLock
- If TRUE, the instance will be locked after validationpublic final boolean isLocked()
public final T lock()
protected final void checkLocked(java.lang.String method)
IllegalStateException
if this instance has been locked. Calling this method resets the validation
status of this configuration.method
- The name of the method that is trying to modify this instance