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,AbstractSchemaElement,ActiveDirectoryAuthenticationResponseHandler,AggregateAuthenticationHandler,AggregateAuthenticationResponseHandler,AggregateDnResolver,AggregateEntryResolver,Authenticator,BindConnectionInitializer,BindConnectionPassivator,DefaultConnectionFactory,DefaultLdapEntryManager,Dn,EDirectoryAuthenticationResponseHandler,Extensions,FormatDnResolver,FreeIPAAuthenticationResponseHandler,KeyStoreCredentialConfig,LdapAttribute,MessageFunctional,Schema,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 booleanimmutableWhether 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 voidassertMutable()Asserts that this object is in a state to permit mutations.voidfreeze()Freezes this object, making it immutable.protected static voidfreeze(Object object)Makes the supplied object immutable if it is an instance ofFreezable.protected static voidfreeze(Object[] objects)Iterates over the supplied objects and invokesFreezable.freeze()for any object that is an instance ofFreezable.booleanisFrozen()Determines whether this object is frozen, i.e. immutable.
-
-
-
Method Detail
-
freeze
public void freeze()
Description copied from interface:FreezableFreezes this object, making it immutable.
-
isFrozen
public final boolean isFrozen()
Description copied from interface:FreezableDetermines whether this object is frozen, i.e. immutable.- Specified by:
isFrozenin interfaceFreezable- Returns:
- True if
Freezable.freeze()has been invoked, false otherwise.
-
assertMutable
public final void assertMutable()
Description copied from interface:FreezableAsserts 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:
assertMutablein 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
-
-