Class LazyInitializer<T>

  • Type Parameters:
    T - type of value
    All Implemented Interfaces:
    java.io.Serializable, java.util.function.Supplier<T>, IClusterable

    public abstract class LazyInitializer<T>
    extends java.lang.Object
    implements java.util.function.Supplier<T>, IClusterable
    An abstraction for lazy-initializing values. Guarantees only a single instance of the value is created. Initialized value WILL NOT be serialized, and will be recreated upon de-serialization.
    Author:
    igor
    See Also:
    Serialized Form
    • Constructor Detail

      • LazyInitializer

        public LazyInitializer()
    • Method Detail

      • get

        public T get()
        Specified by:
        get in interface java.util.function.Supplier<T>
      • createInstance

        protected abstract T createInstance()
        Creates the lazy value
        Returns:
        new instance of the value