Code example for LoadingCache

Methods: getIfPresent

0
    return source.hash(Hashing.sha1());
  } 
 
  @Override 
  public boolean contains(Path path) {
    return loadingCache.getIfPresent(path) != null;
  } 
 
  /** 
   * @return The {@link com.google.common.hash.HashCode} of the contents of path. 
   */ 
  @Override 
  public HashCode get(Path path) {
    HashCode sha1;
    try { 
      // Ignored paths will not generate file change events and so are not invalidated correctly. 
      // Where ignored paths are output files, they are generated by each build and will not 
      // generate cache hits so not caching them is likely a performance win in any case. 
      if (projectFilesystem.isIgnored(path)) {
        sha1 = getHashCode(path);
Contextual code suggestions in your IDE  Get Codota for Java