public V put ( K key , V value ) { V previous = null ; synchronized ( this ) { long timeout = System . currentTimeMillis ( ) + TimeUnit . MILLISECONDS . convert ( expirationTimeout , expirationTimeUnit ) ; final Pair < V , Long > previousPair = lruCache . put ( key , new Pair <> ( value , timeout ) ) ; if ( previousPair != null ) { previous = previousPair . first ; } } return previous ; }
Puts a value in the cache computing an expiration time