Code example for Cache

Methods: put

0
        StoredEquivalenceResult restoredResult = delegate.store(result);
        if(result.subject() instanceof Item) {
            mrwItemCache.put(result.subject().getCanonicalUri(), restoredResult);
        } 
        if(result.subject() instanceof Container) {
            mrwContainerCache.put(result.subject().getCanonicalUri(), restoredResult);
        } 
        return restoredResult;
    } 
 
    @Override 
    public StoredEquivalenceResult forId(String canonicalUri) {
        StoredEquivalenceResult equivalenceResult = mrwItemCache.getIfPresent(canonicalUri);
        if(equivalenceResult != null) {
            return equivalenceResult;
        } 
         
        equivalenceResult = mrwContainerCache.getIfPresent(canonicalUri);
        if(equivalenceResult != null) {
            return equivalenceResult;
Contextual code suggestions in your IDE  Get Codota for Java