* Copyright (C) 2011 The Guava Authors
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
put(Object, Object), and are stored in the cache until either evicted or manually invalidated.
Implementations of this interface are expected to be thread-safe, and can be safely accessed by multiple concurrent threads.
Note that while this class is still annotated as
Beta, the API is frozen from a
consumer's standpoint. In other words existing methods are all considered
won't be changed without going through an 18 month deprecation cycle; however new methods may be
added at any time.
keyin this cache, obtaining that value from
valueLoaderif necessary. No observable state associated with this cache is modified until loading completes. This method provides a simple substitute for the conventional "if cached, return; otherwise create, cache and return" pattern.
Warning: as with
valueLoader must not return
null; it may either return a non-null value or throw an exception.
put(k, v)on this map once for each mapping from key
vin the specified map. The behavior of this operation is undefined if the specified map is modified while the operation is in progress.