Package 

Class ResettableDelegate

  • All Implemented Interfaces:
    kotlin.properties.ReadOnlyProperty , kotlin.properties.ReadWriteProperty

    
    public final class ResettableDelegate<T extends Object>
     implements ReadWriteProperty<Any, T>
                        

    A property delegation class that allows resetting its value to an uninitialized state.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private final Function0<T> initializer
    • Constructor Summary

      Constructors 
      Constructor Description
      ResettableDelegate(T uninitializedValue, Function0<T> initializer)
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final Function0<T> getInitializer()
      T getValue(Object thisRef, KProperty<?> property)
      Unit setValue(Object thisRef, KProperty<?> property, T value)
      • Methods inherited from class java.lang.Object

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

      • ResettableDelegate

        ResettableDelegate(T uninitializedValue, Function0<T> initializer)
        Parameters:
        uninitializedValue - the value representing an uninitialized state
        initializer - a lambda function that provides the initial value when accessed for first time