Code example for Cache

Methods: getIfPresent

    public String getChanges(@Nonnull Revision from,
                             @Nonnull Revision to,
                             @Nonnull String path) {
        PathRev key = diffCacheKey(path, from, to);
        StringValue diff = diffCache.getIfPresent(key);
        return diff != null ? diff.toString() : null;
    public Entry newEntry(@Nonnull Revision from,
                          @Nonnull Revision to) {
        return new MemoryEntry(from, to);
    public CacheStats getDiffCacheStats() {
        return diffCacheStats;
Connect your IDE to all the code out there  Get Codota for Java