Created
February 23, 2021 14:39
-
-
Save dalexandrov/a60afbca1b35d6bac32ddf61f34a9d02 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static class Neo4JCounterWrapper implements Counter { | |
private final Supplier<Long> fn; | |
private Neo4JCounterWrapper(Supplier<Long> fn) { | |
this.fn = fn; | |
} | |
@Override | |
public void inc() { | |
throw new UnsupportedOperationException(); | |
} | |
@Override | |
public void inc(long n) { | |
throw new UnsupportedOperationException(); | |
} | |
@Override | |
public long getCount() { | |
return fn.get(); | |
} | |
} | |
private static class Neo4JGaugeWrapper<T> implements Gauge<T> { | |
private final Supplier<T> supplier; | |
private Neo4JGaugeWrapper(Supplier<T> supplier) { | |
this.supplier = supplier; | |
} | |
@Override | |
public T getValue() { | |
return supplier.get(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment