test_class.declarator: CACHE_EXPIRY = TimeUnit.SECONDS.toMillis(2)
test_class.modifier: private static final
test_class.original_string: private static final long CACHE_EXPIRY = TimeUnit.SECONDS.toMillis(2);
test_class.type: long
test_class.var_name: CACHE_EXPIRY
test_class.declarator: RESPONSE_1 = "ACTION 1"
test_class.modifier: private static final
test_class.original_string: private static final String RESPONSE_1 = "ACTION 1";
test_class.type: String
test_class.var_name: RESPONSE_1
test_class.declarator: RESPONSE_2 = "ACTION 2"
test_class.modifier: private static final
test_class.original_string: private static final String RESPONSE_2 = "ACTION 2";
test_class.type: String
test_class.var_name: RESPONSE_2
test_class.declarator: CACHE_ACTION = () -> {
          byte[] array = new byte[8];
          new Random().nextBytes(array);
          return new String(array, StandardCharsets.UTF_8);
      }
test_class.modifier: private static final
test_class.original_string: private static final Supplier<String> CACHE_ACTION = () -> {
          byte[] array = new byte[8];
          new Random().nextBytes(array);
          return new String(array, StandardCharsets.UTF_8);
      };
test_class.type: Supplier<String>
test_class.var_name: CACHE_ACTION
test_class.declarator: PREDICTABLE_CACHE_ACTION_1 = () -> RESPONSE_1
test_class.modifier: private static final
test_class.original_string: private static final Supplier<String> PREDICTABLE_CACHE_ACTION_1 = () -> RESPONSE_1;
test_class.type: Supplier<String>
test_class.var_name: PREDICTABLE_CACHE_ACTION_1
test_class.declarator: PREDICTABLE_CACHE_ACTION_2 = () -> RESPONSE_2
test_class.modifier: private static final
test_class.original_string: private static final Supplier<String> PREDICTABLE_CACHE_ACTION_2 = () -> RESPONSE_2;
test_class.type: Supplier<String>
test_class.var_name: PREDICTABLE_CACHE_ACTION_2
test_class.declarator: FIRST_TEST_KEY = "FIRST_TEST_KEY"
test_class.modifier: private static final
test_class.original_string: private static final String FIRST_TEST_KEY = "FIRST_TEST_KEY";
test_class.type: String
test_class.var_name: FIRST_TEST_KEY
test_class.declarator: SECOND_TEST_KEY = "SECOND_TEST_KEY"
test_class.modifier: private static final
test_class.original_string: private static final String SECOND_TEST_KEY = "SECOND_TEST_KEY";
test_class.type: String
test_class.var_name: SECOND_TEST_KEY
test_class.declarator: subject
test_class.modifier: private
test_class.original_string: private ExpiringCacheMap<String, String> subject;
test_class.type: ExpiringCacheMap<String, String>
test_class.var_name: subject
test_class.file: bundles/org.openhab.core/src/test/java/org/openhab/core/cache/ExpiringCacheMapTest.java
test_class.identifier: ExpiringCacheMapTest
test_case.body: @Test
      public void testRefresh() {
          subject.put(FIRST_TEST_KEY, CACHE_ACTION);
  
          String value1 = subject.get(FIRST_TEST_KEY);
  
          // refresh item
          String value2 = subject.refresh(FIRST_TEST_KEY);
          assertNotEquals(value1, value2);
  
          // refresh all
          final Collection<String> expectedValues = new LinkedList<>();
          expectedValues.add(value2);
  
          final Collection<String> values = subject.refreshAll();
          assertNotEquals(expectedValues, values);
      }
test_case.class_method_signature: ExpiringCacheMapTest.testRefresh()
test_case.full_signature: @Test public void testRefresh()
test_case.identifier: testRefresh
test_case.invocations: put get refresh assertNotEquals add refreshAll assertNotEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testRefresh()
focal_class.declarator: logger = LoggerFactory.getLogger(ExpiringCacheMap.class)
focal_class.modifier: private final
focal_class.original_string: private final Logger logger = LoggerFactory.getLogger(ExpiringCacheMap.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: expiry
focal_class.modifier: private final
focal_class.original_string: private final long expiry;
focal_class.type: long
focal_class.var_name: expiry
focal_class.declarator: items
focal_class.modifier: private final
focal_class.original_string: private final ConcurrentMap<K, ExpiringCache<@Nullable V>> items;
focal_class.type: ConcurrentMap<K, ExpiringCache<@Nullable V>>
focal_class.var_name: items
focal_class.file: bundles/org.openhab.core/src/main/java/org/openhab/core/cache/ExpiringCacheMap.java
focal_class.identifier: ExpiringCacheMap
focal_class.class_method_signature: ExpiringCacheMap.ExpiringCacheMap(Duration expiry)
focal_class.full_signature: public  ExpiringCacheMap(Duration expiry)
focal_class.identifier: ExpiringCacheMap
focal_class.modifiers: public
focal_class.parameters: (Duration expiry)
focal_class.signature:  ExpiringCacheMap(Duration expiry)
focal_class.class_method_signature: ExpiringCacheMap.ExpiringCacheMap(long expiry)
focal_class.full_signature: public  ExpiringCacheMap(long expiry)
focal_class.identifier: ExpiringCacheMap
focal_class.modifiers: public
focal_class.parameters: (long expiry)
focal_class.signature:  ExpiringCacheMap(long expiry)
focal_class.class_method_signature: ExpiringCacheMap.put(K key, Supplier<@Nullable V> action)
focal_class.full_signature: public void put(K key, Supplier<@Nullable V> action)
focal_class.identifier: put
focal_class.modifiers: public
focal_class.parameters: (K key, Supplier<@Nullable V> action)
focal_class.return: void
focal_class.signature: void put(K key, Supplier<@Nullable V> action)
focal_class.class_method_signature: ExpiringCacheMap.put(K key, ExpiringCache<@Nullable V> item)
focal_class.full_signature: public void put(K key, ExpiringCache<@Nullable V> item)
focal_class.identifier: put
focal_class.modifiers: public
focal_class.parameters: (K key, ExpiringCache<@Nullable V> item)
focal_class.return: void
focal_class.signature: void put(K key, ExpiringCache<@Nullable V> item)
focal_class.class_method_signature: ExpiringCacheMap.putIfAbsent(K key, ExpiringCache<V> item)
focal_class.full_signature: public void putIfAbsent(K key, ExpiringCache<V> item)
focal_class.identifier: putIfAbsent
focal_class.modifiers: public
focal_class.parameters: (K key, ExpiringCache<V> item)
focal_class.return: void
focal_class.signature: void putIfAbsent(K key, ExpiringCache<V> item)
focal_class.class_method_signature: ExpiringCacheMap.putIfAbsentAndGet(K key, Supplier<V> action)
focal_class.full_signature: public @Nullable V putIfAbsentAndGet(K key, Supplier<V> action)
focal_class.identifier: putIfAbsentAndGet
focal_class.modifiers: public @Nullable
focal_class.parameters: (K key, Supplier<V> action)
focal_class.return: V
focal_class.signature: V putIfAbsentAndGet(K key, Supplier<V> action)
focal_class.class_method_signature: ExpiringCacheMap.putIfAbsentAndGet(K key, ExpiringCache<V> item)
focal_class.full_signature: public @Nullable V putIfAbsentAndGet(K key, ExpiringCache<V> item)
focal_class.identifier: putIfAbsentAndGet
focal_class.modifiers: public @Nullable
focal_class.parameters: (K key, ExpiringCache<V> item)
focal_class.return: V
focal_class.signature: V putIfAbsentAndGet(K key, ExpiringCache<V> item)
focal_class.class_method_signature: ExpiringCacheMap.putValue(K key, @Nullable V value)
focal_class.full_signature: @SuppressWarnings({ "null", "unused" }) public void putValue(K key, @Nullable V value)
focal_class.identifier: putValue
focal_class.modifiers: @SuppressWarnings({ "null", "unused" }) public
focal_class.parameters: (K key, @Nullable V value)
focal_class.return: void
focal_class.signature: void putValue(K key, @Nullable V value)
focal_class.class_method_signature: ExpiringCacheMap.containsKey(K key)
focal_class.full_signature: public boolean containsKey(K key)
focal_class.identifier: containsKey
focal_class.modifiers: public
focal_class.parameters: (K key)
focal_class.return: boolean
focal_class.signature: boolean containsKey(K key)
focal_class.class_method_signature: ExpiringCacheMap.remove(K key)
focal_class.full_signature: public void remove(K key)
focal_class.identifier: remove
focal_class.modifiers: public
focal_class.parameters: (K key)
focal_class.return: void
focal_class.signature: void remove(K key)
focal_class.class_method_signature: ExpiringCacheMap.clear()
focal_class.full_signature: public void clear()
focal_class.identifier: clear
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void clear()
focal_class.class_method_signature: ExpiringCacheMap.keys()
focal_class.full_signature: public synchronized Set<K> keys()
focal_class.identifier: keys
focal_class.modifiers: public synchronized
focal_class.parameters: ()
focal_class.return: Set<K>
focal_class.signature: Set<K> keys()
focal_class.class_method_signature: ExpiringCacheMap.get(K key)
focal_class.full_signature: @SuppressWarnings({ "null", "unused" }) public @Nullable V get(K key)
focal_class.identifier: get
focal_class.modifiers: @SuppressWarnings({ "null", "unused" }) public @Nullable
focal_class.parameters: (K key)
focal_class.return: V
focal_class.signature: V get(K key)
focal_class.class_method_signature: ExpiringCacheMap.values()
focal_class.full_signature: public synchronized Collection<@Nullable V> values()
focal_class.identifier: values
focal_class.modifiers: public synchronized
focal_class.parameters: ()
focal_class.return: Collection<@Nullable V>
focal_class.signature: Collection<@Nullable V> values()
focal_class.class_method_signature: ExpiringCacheMap.invalidate(K key)
focal_class.full_signature: @SuppressWarnings({ "null", "unused" }) public synchronized void invalidate(K key)
focal_class.identifier: invalidate
focal_class.modifiers: @SuppressWarnings({ "null", "unused" }) public synchronized
focal_class.parameters: (K key)
focal_class.return: void
focal_class.signature: void invalidate(K key)
focal_class.class_method_signature: ExpiringCacheMap.invalidateAll()
focal_class.full_signature: public synchronized void invalidateAll()
focal_class.identifier: invalidateAll
focal_class.modifiers: public synchronized
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void invalidateAll()
focal_class.class_method_signature: ExpiringCacheMap.refresh(K key)
focal_class.full_signature: @SuppressWarnings({ "null", "unused" }) public synchronized @Nullable V refresh(K key)
focal_class.identifier: refresh
focal_class.modifiers: @SuppressWarnings({ "null", "unused" }) public synchronized @Nullable
focal_class.parameters: (K key)
focal_class.return: V
focal_class.signature: V refresh(K key)
focal_class.class_method_signature: ExpiringCacheMap.refreshAll()
focal_class.full_signature: public synchronized Collection<@Nullable V> refreshAll()
focal_class.identifier: refreshAll
focal_class.modifiers: public synchronized
focal_class.parameters: ()
focal_class.return: Collection<@Nullable V>
focal_class.signature: Collection<@Nullable V> refreshAll()
focal_method.body: @SuppressWarnings({ "null", "unused" })
      public synchronized @Nullable V refresh(K key) {
          final ExpiringCache<@Nullable V> item = items.get(key);
          if (item == null) {
              logger.debug("No item for key '{}' found", key);
              return null;
          } else {
              return item.refreshValue();
          }
      }
focal_method.class_method_signature: ExpiringCacheMap.refresh(K key)
focal_method.full_signature: @SuppressWarnings({ "null", "unused" }) public synchronized @Nullable V refresh(K key)
focal_method.identifier: refresh
focal_method.invocations: get debug refreshValue
focal_method.modifiers: @SuppressWarnings({ "null", "unused" }) public synchronized @Nullable
focal_method.parameters: (K key)
focal_method.return: V
focal_method.signature: V refresh(K key)