@Test public void hash() { PathProperties properties = new PathProperties(); String hash0 = properties.hash(); properties.add(NoopJournalContext.INSTANCE, ROOT, READ_CACHE); String hash1 = properties.hash(); Assert.assertNotEquals(hash0, hash1); properties.add(NoopJournalContext.INSTANCE, DIR1, READ_CACHE_WRITE_CACHE_THROUGH); String hash2 = properties.hash(); Assert.assertNotEquals(hash0, hash2); Assert.assertNotEquals(hash1, hash2); Set<String> keys = new HashSet<>(); keys.add(PropertyKey.USER_FILE_READ_TYPE_DEFAULT.getName()); properties.remove(NoopJournalContext.INSTANCE, DIR1, keys); String hash3 = properties.hash(); Assert.assertNotEquals(hash0, hash3); Assert.assertNotEquals(hash1, hash3); Assert.assertNotEquals(hash2, hash3); properties.removeAll(NoopJournalContext.INSTANCE, DIR1); String hash4 = properties.hash(); Assert.assertEquals(hash1, hash4); properties.removeAll(NoopJournalContext.INSTANCE, ROOT); Assert.assertEquals(hash0, properties.hash()); }
public String hash() { try (LockResource r = new LockResource(mLock.readLock())) { return mHash.get(); } }
PathProperties implements DelegatingJournaled { public String hash() { try (LockResource r = new LockResource(mLock.readLock())) { return mHash.get(); } } }
PathProperties implements DelegatingJournaled { public String hash() { try (LockResource r = new LockResource(mLock.readLock())) { return mHash.get(); } }  }
PathProperties implements DelegatingJournaled { public String hash() { try (LockResource r = new LockResource(mLock.readLock())) { return mHash.get(); } }  PathPropertiesView snapshot(); Map<String, Map<String, String>> get(); void add(Supplier<JournalContext> ctx, String path, Map<PropertyKey, String> properties); void remove(Supplier<JournalContext> ctx, String path, Set<String> keys); void removeAll(Supplier<JournalContext> ctx, String path); String hash(); @Override Journaled getDelegate(); }
PathProperties implements DelegatingJournaled { public String hash() { try (LockResource r = new LockResource(mLock.readLock())) { return mHash.get(); } }  PathPropertiesView snapshot(); Map<String, Map<String, String>> get(); void add(Supplier<JournalContext> ctx, String path, Map<PropertyKey, String> properties); void remove(Supplier<JournalContext> ctx, String path, Set<String> keys); void removeAll(Supplier<JournalContext> ctx, String path); String hash(); @Override Journaled getDelegate();  }