Class ExtensionValuesStore


  • public class ExtensionValuesStore
    extends java.lang.Object
    Used inside implementations of ExtensionContext to store and retrieve values.

    Copy of org.junit.jupiter.engine.execution.ExtensionValuesStore from junit-jupiter-engine (because exactly the same behaviour is required).

    Since:
    20.12.2021
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void closeAllStoredCloseableValues()
      Close all values that implement ExtensionContext.Store.CloseableResource.
      protected java.lang.Object get​(org.junit.jupiter.api.extension.ExtensionContext.Namespace namespace, java.lang.Object key)  
      protected <T> T get​(org.junit.jupiter.api.extension.ExtensionContext.Namespace namespace, java.lang.Object key, java.lang.Class<T> requiredType)  
      protected <K,​V>
      java.lang.Object
      getOrComputeIfAbsent​(org.junit.jupiter.api.extension.ExtensionContext.Namespace namespace, K key, java.util.function.Function<K,​V> defaultCreator)  
      protected <K,​V>
      V
      getOrComputeIfAbsent​(org.junit.jupiter.api.extension.ExtensionContext.Namespace namespace, K key, java.util.function.Function<K,​V> defaultCreator, java.lang.Class<V> requiredType)  
      protected void put​(org.junit.jupiter.api.extension.ExtensionContext.Namespace namespace, java.lang.Object key, java.lang.Object value)  
      protected java.lang.Object remove​(org.junit.jupiter.api.extension.ExtensionContext.Namespace namespace, java.lang.Object key)  
      protected <T> T remove​(org.junit.jupiter.api.extension.ExtensionContext.Namespace namespace, java.lang.Object key, java.lang.Class<T> requiredType)  
      • Methods inherited from class java.lang.Object

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

      • closeAllStoredCloseableValues

        public void closeAllStoredCloseableValues()
        Close all values that implement ExtensionContext.Store.CloseableResource.

        Note: Only close values stored in this instance. This implementation does not close values in parent stores.

      • get

        protected java.lang.Object get​(org.junit.jupiter.api.extension.ExtensionContext.Namespace namespace,
                                       java.lang.Object key)
      • get

        protected <T> T get​(org.junit.jupiter.api.extension.ExtensionContext.Namespace namespace,
                            java.lang.Object key,
                            java.lang.Class<T> requiredType)
      • getOrComputeIfAbsent

        protected <K,​V> java.lang.Object getOrComputeIfAbsent​(org.junit.jupiter.api.extension.ExtensionContext.Namespace namespace,
                                                                    K key,
                                                                    java.util.function.Function<K,​V> defaultCreator)
      • getOrComputeIfAbsent

        protected <K,​V> V getOrComputeIfAbsent​(org.junit.jupiter.api.extension.ExtensionContext.Namespace namespace,
                                                     K key,
                                                     java.util.function.Function<K,​V> defaultCreator,
                                                     java.lang.Class<V> requiredType)
      • put

        protected void put​(org.junit.jupiter.api.extension.ExtensionContext.Namespace namespace,
                           java.lang.Object key,
                           java.lang.Object value)
      • remove

        protected java.lang.Object remove​(org.junit.jupiter.api.extension.ExtensionContext.Namespace namespace,
                                          java.lang.Object key)
      • remove

        protected <T> T remove​(org.junit.jupiter.api.extension.ExtensionContext.Namespace namespace,
                               java.lang.Object key,
                               java.lang.Class<T> requiredType)