Code example for Cache

Methods: getIfPresentput

0
        if (!url.isPresent()) {
            return Optional.absent();
        } 
        logger.debug("Calculating md5 hash, url:{}", url);
        if (isHotReloadModeOff()) { 
            final String md5 = cache.getIfPresent(url.get());
 
            logger.debug("md5 hash:{}", md5);
 
            if (md5 != null) {
                return Optional.of(md5);
            } 
        } 
 
        final InputStream is = url.get().openStream();
        final String md5 = getMD5Checksum(is);
 
        if (isHotReloadModeOff()) { 
            logger.debug("caching url:{} with hash:{}", url, md5);
 
            cache.put(url.get(), md5);
        } 
 
        return Optional.fromNullable(md5);
    } 
 
Connect your IDE to all the code out there  Get Codota for Java