Package org.ldaptive

Class AbstractFreezable

    • Field Detail

      • immutable

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

      • AbstractFreezable

        public AbstractFreezable()
    • Method Detail

      • 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