Class ParameterizedLazy

  • All Implemented Interfaces:
    kotlin.Function , kotlin.coroutines.SuspendFunction1

    
    public final class ParameterizedLazy<T extends Object, R extends Object>
     implements SuspendFunction1<T, R>
                        

    A lazy delegate which takes a parameter and provides a value based on it. The value is calculated only once and stored in a map.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      R invoke(T param) Provides either an existing R object or creates a new one using initializer function.
      • Methods inherited from class java.lang.Object

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

      • ParameterizedLazy

        ParameterizedLazy(SuspendFunction1<T, R> initializer)
        Parameters:
        initializer - A function that creates a new value based on the parameter.
    • Method Detail

      • invoke

         R invoke(T param)

        Provides either an existing R object or creates a new one using initializer function.