Class LazyMember<T>

  • Type Parameters:
    T - Type of the lazy member

    If we find ourselves creating a whole bunch of these in our code, we need to rethink this. Each lazy member holds the actual member and a delegate. That can turn into a whole lot of overhead


    public class LazyMember<T>
    extends Object
    Wrapper class for lazy members. Does lazy initialization of member on first access.
    • Constructor Detail

      • LazyMember

        public LazyMember​(ILazyMember<T> lazyImplementation)
        Constructor.
        Parameters:
        lazyImplementation - The initialization delegate to call for the item on first access
    • Method Detail

      • getMember

        public T getMember()
        Public accessor for the lazy member. Lazy initializes the member on first access
        Returns:
        the member