Package org.ldaptive
Class AbstractFreezable
- java.lang.Object
-
- org.ldaptive.AbstractFreezable
-
- All Implemented Interfaces:
Freezable
- Direct Known Subclasses:
AbstractAuthenticationHandler
,AbstractConfig
,AbstractConnectionPool
,AbstractConnectionStrategy
,AbstractConnectionValidator
,AbstractEntryHandler
,AbstractOperationFactory
,AbstractPruneStrategy
,ActiveDirectoryAuthenticationResponseHandler
,AggregateAuthenticationHandler
,AggregateAuthenticationResponseHandler
,AggregateDnResolver
,AggregateEntryResolver
,Authenticator
,BindConnectionInitializer
,BindConnectionPassivator
,DefaultConnectionFactory
,DefaultLdapEntryManager
,Dn
,EDirectoryAuthenticationResponseHandler
,FormatDnResolver
,FreeIPAAuthenticationResponseHandler
,KeyStoreCredentialConfig
,LdapAttribute
,MessageFunctional
,X509CredentialConfig
public abstract class AbstractFreezable extends Object implements Freezable
Base class for objects that can be made immutable.
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
immutable
Whether this object has been marked immutable.
-
Constructor Summary
Constructors Constructor Description AbstractFreezable()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
assertMutable()
Asserts that this object is in a state to permit mutations.void
freeze()
Freezes this object, making it immutable.protected static void
freeze(Object object)
Makes the supplied object immutable if it is an instance ofFreezable
.protected static void
freeze(Object[] objects)
Iterates over the supplied objects and invokesFreezable.freeze()
for any object that is an instance ofFreezable
.boolean
isFrozen()
Determines whether this object is frozen, i.e. immutable.
-
-
-
Method Detail
-
freeze
public void freeze()
Description copied from interface:Freezable
Freezes this object, making it immutable.
-
isFrozen
public final boolean isFrozen()
Description copied from interface:Freezable
Determines whether this object is frozen, i.e. immutable.- Specified by:
isFrozen
in interfaceFreezable
- Returns:
- True if
Freezable.freeze()
has been invoked, false otherwise.
-
assertMutable
public final void assertMutable()
Description copied from interface:Freezable
Asserts that this object is in a state to permit mutations. Classes that implement this interface should invoke this method prior to performing any mutation of internal state as a means of implementing the "frozen" usage contract.- Specified by:
assertMutable
in interfaceFreezable
-
freeze
protected static void freeze(Object[] objects)
Iterates over the supplied objects and invokesFreezable.freeze()
for any object that is an instance ofFreezable
.- Parameters:
objects
- to make immutable
-
-