MCPcopy Index your code
hub / github.com/seaswalker/spring-analysis / cacheLoader

Method cacheLoader

src/main/java/cache/CacheDemo.java:17–31  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

15public class CacheDemo {
16
17 @Test
18 public void cacheLoader() throws ExecutionException {
19 LoadingCache<String, String> cache = CacheBuilder.newBuilder().maximumSize(2)
20 .build(new CacheLoader<String, String>() {
21 @Override
22 public String load(String s) throws Exception {
23 return "Hello: " + s;
24 }
25 });
26 System.out.println(cache.get("China"));
27 cache.put("US", "US");
28 System.out.println(cache.get("US"));
29 //放不进去
30 cache.put("UK", "UK");
31 }
32
33}

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected