Class LazyInitializer<V>

  • Type Parameters:
    V - The value type
    Direct Known Subclasses:
    IoBufferLazyInitializer, LazyInitializedCacheMap.NoopInitializer

    public abstract class LazyInitializer<V>
    extends java.lang.Object
    An abstract class which provides semantics for an object which will be only fully initialized when requested to. It allows to avoid loosing time when early initializing unnecessary objects.
    Since:
    MINA 2.0.0-M2
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private V value
      The value that results on the init() call.
    • Constructor Summary

      Constructors 
      Constructor Description
      LazyInitializer()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      V get()  
      abstract V init()
      Initializes the value.
      • Methods inherited from class java.lang.Object

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

      • value

        private V value
        The value that results on the init() call. If null, it means that the value has not been initialized yet.
    • Constructor Detail

      • LazyInitializer

        public LazyInitializer()
    • Method Detail

      • init

        public abstract V init()
        Initializes the value.
        Returns:
        the initialized value
      • get

        public V get()
        Returns:
        the value resulting from the initialization.