Code example for LoadingCache

Methods: invalidate

0
    public T get(String id) throws ExecutionException {
        return loadingCache.get(id).orNull();
    } 
 
    public void remove(String id) {
        loadingCache.invalidate(id);
    } 
 
    public void put(String id, T value) {
        if (id == null || value == null) {
            return; 
        } 
        loadingCache.put(id, Optional.fromNullable(value));
    } 
 
    public void clear() { 
        loadingCache.invalidateAll();
    } 
 
}