public V getOrLoad ( K key , CacheLoader < V > loader ) { V item ; // synchronized( this ) { if ( containsKey ( key ) ) { return get ( key ) ; } //} item = loader . load ( ) ; if ( item != null ) { putIfAbsent ( key , item ) ; return get ( key ) ; } else { return null ; } }
Retrieves the value for the specified key . If no value is present this method will attempt to load a value and place it into the cache . This method appears atomic in accordance with the contract of a