@@ -598,7 +598,7 @@ default <V> V getOrDefault(Object key, Class<V> requiredType, V defaultValue) {
598
598
* further details.
599
599
*
600
600
* <p>If {@code type} implements {@link ExtensionContext.Store.CloseableResource}
601
- * the {@code close()} method will be invoked on the stored object when
601
+ * or {@link AutoCloseable} the {@code close()} method will be invoked on the stored object when
602
602
* the store is closed.
603
603
*
604
604
* @param type the type of object to retrieve; never {@code null}
@@ -608,6 +608,7 @@ default <V> V getOrDefault(Object key, Class<V> requiredType, V defaultValue) {
608
608
* @see #getOrComputeIfAbsent(Object, Function)
609
609
* @see #getOrComputeIfAbsent(Object, Function, Class)
610
610
* @see CloseableResource
611
+ * @see AutoCloseable
611
612
*/
612
613
@ API (status = STABLE , since = "5.1" )
613
614
default <V > V getOrComputeIfAbsent (Class <V > type ) {
@@ -628,7 +629,7 @@ default <V> V getOrComputeIfAbsent(Class<V> type) {
628
629
* {@link #getOrComputeIfAbsent(Object, Function, Class)} instead.
629
630
*
630
631
* <p>If the created value is an instance of {@link ExtensionContext.Store.CloseableResource}
631
- * the {@code close()} method will be invoked on the stored object when
632
+ * or {@link AutoCloseable} the {@code close()} method will be invoked on the stored object when
632
633
* the store is closed.
633
634
*
634
635
* @param key the key; never {@code null}
@@ -640,6 +641,7 @@ default <V> V getOrComputeIfAbsent(Class<V> type) {
640
641
* @see #getOrComputeIfAbsent(Class)
641
642
* @see #getOrComputeIfAbsent(Object, Function, Class)
642
643
* @see CloseableResource
644
+ * @see AutoCloseable
643
645
*/
644
646
<K , V > Object getOrComputeIfAbsent (K key , Function <K , V > defaultCreator );
645
647
@@ -655,8 +657,8 @@ default <V> V getOrComputeIfAbsent(Class<V> type) {
655
657
* the {@code key} as input), stored, and returned.
656
658
*
657
659
* <p>If {@code requiredType} implements {@link ExtensionContext.Store.CloseableResource}
658
- * the {@code close()} method will be invoked on the stored object when
659
- * the store is closed.
660
+ * or {@link AutoCloseable} the {@code close()} method will be invoked on the stored
661
+ * object when the store is closed.
660
662
*
661
663
* @param key the key; never {@code null}
662
664
* @param defaultCreator the function called with the supplied {@code key}
@@ -668,6 +670,7 @@ default <V> V getOrComputeIfAbsent(Class<V> type) {
668
670
* @see #getOrComputeIfAbsent(Class)
669
671
* @see #getOrComputeIfAbsent(Object, Function)
670
672
* @see CloseableResource
673
+ * @see AutoCloseable
671
674
*/
672
675
<K , V > V getOrComputeIfAbsent (K key , Function <K , V > defaultCreator , Class <V > requiredType );
673
676
@@ -679,22 +682,23 @@ default <V> V getOrComputeIfAbsent(Class<V> type) {
679
682
* overwrite it.
680
683
*
681
684
* <p>If the {@code value} is an instance of {@link ExtensionContext.Store.CloseableResource}
682
- * the {@code close()} method will be invoked on the stored object when
683
- * the store is closed.
685
+ * or {@link AutoCloseable} the {@code close()} method will be invoked on the stored
686
+ * object when the store is closed.
684
687
*
685
688
* @param key the key under which the value should be stored; never
686
689
* {@code null}
687
690
* @param value the value to store; may be {@code null}
688
691
* @see CloseableResource
692
+ * @see AutoCloseable
689
693
*/
690
694
void put (Object key , Object value );
691
695
692
696
/**
693
697
* Remove the value that was previously stored under the supplied {@code key}.
694
698
*
695
699
* <p>The value will only be removed in the current {@link ExtensionContext},
696
- * not in ancestors. In addition, the {@link CloseableResource} API will not
697
- * be honored for values that are manually removed via this method.
700
+ * not in ancestors. In addition, the {@link CloseableResource} and {@link AutoCloseable}
701
+ * API will not be honored for values that are manually removed via this method.
698
702
*
699
703
* <p>For greater type safety, consider using {@link #remove(Object, Class)}
700
704
* instead.
@@ -711,8 +715,8 @@ default <V> V getOrComputeIfAbsent(Class<V> type) {
711
715
* under the supplied {@code key}.
712
716
*
713
717
* <p>The value will only be removed in the current {@link ExtensionContext},
714
- * not in ancestors. In addition, the {@link CloseableResource} API will not
715
- * be honored for values that are manually removed via this method.
718
+ * not in ancestors. In addition, the {@link CloseableResource} and {@link AutoCloseable}
719
+ * API will not be honored for values that are manually removed via this method.
716
720
*
717
721
* @param key the key; never {@code null}
718
722
* @param requiredType the required type of the value; never {@code null}
0 commit comments