Package 

Class AndroidLazyEvaluator


  • @ApiStatus.Internal() 
    public final class AndroidLazyEvaluator<T>
    
                        

    Class that evaluates a function lazily. It means the evaluator function is called only when getValue is called, and it's cached. Same as LazyEvaluator but accepts Context as an argument for getValue.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private volatile T value
    • Method Summary

      Modifier and Type Method Description
      T getValue(@NotNull() Context context) Executes the evaluator function and caches its result, so that it's called only once, unlessresetValue is called.
      T getValue(@NotNull() Context context) Executes the evaluator function and caches its result, so that it's called only once, unlessresetValue is called.
      void resetValue() Resets the internal value and forces the evaluator function to be called the next timegetValue() is called.
      • Methods inherited from class java.lang.Object

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

    • Method Detail

      • getValue

        @Nullable() T getValue(@NotNull() Context context)

        Executes the evaluator function and caches its result, so that it's called only once, unlessresetValue is called.

      • getValue

        @Nullable() T getValue(@NotNull() Context context)

        Executes the evaluator function and caches its result, so that it's called only once, unlessresetValue is called.

      • resetValue

         void resetValue()

        Resets the internal value and forces the evaluator function to be called the next timegetValue() is called.