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,SchemaElementRegistry,X509CredentialConfig
Base class for objects that can be made immutable.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanWhether this object has been marked immutable. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidAsserts that this object is in a state to permit mutations.voidfreeze()Freezes this object, making it immutable.protected static voidMakes the supplied object immutable if it is an instance ofFreezable.protected static voidIterates over the supplied objects and invokesFreezable.freeze()for any object that is an instance ofFreezable.final booleanisFrozen()Determines whether this object is frozen, i.e. immutable.
-
Field Details
-
immutable
private volatile boolean immutableWhether this object has been marked immutable.
-
-
Constructor Details
-
AbstractFreezable
public AbstractFreezable()
-
-
Method Details
-
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
Iterates over the supplied objects and invokesFreezable.freeze()for any object that is an instance ofFreezable.- Parameters:
objects- to make immutable
-
freeze
Makes the supplied object immutable if it is an instance ofFreezable.- Parameters:
object- to make immutable
-