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

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
    Whether this object has been marked immutable.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    final void
    Asserts that this object is in a state to permit mutations.
    void
    Freezes this object, making it immutable.
    protected static void
    freeze(Object object)
    Makes the supplied object immutable if it is an instance of Freezable.
    protected static void
    freeze(Object[] objects)
    Iterates over the supplied objects and invokes Freezable.freeze() for any object that is an instance of Freezable.
    final boolean
    Determines whether this object is frozen, i.e. immutable.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • immutable

      private volatile boolean immutable
      Whether this object has been marked immutable.
  • Constructor Details

    • AbstractFreezable

      public AbstractFreezable()
  • Method Details

    • freeze

      public void freeze()
      Description copied from interface: Freezable
      Freezes this object, making it immutable.
      Specified by:
      freeze in interface Freezable
    • isFrozen

      public final boolean isFrozen()
      Description copied from interface: Freezable
      Determines whether this object is frozen, i.e. immutable.
      Specified by:
      isFrozen in interface Freezable
      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 interface Freezable
    • freeze

      protected static void freeze(Object[] objects)
      Iterates over the supplied objects and invokes Freezable.freeze() for any object that is an instance of Freezable.
      Parameters:
      objects - to make immutable
    • freeze

      protected static void freeze(Object object)
      Makes the supplied object immutable if it is an instance of Freezable.
      Parameters:
      object - to make immutable