mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
Remove deprecated methods on ServerCache getHitRatio() -> hitRatio(), getStatistics() -> statistics()
This commit is contained in:
+8
-15
@@ -1,5 +1,6 @@
|
||||
package io.ebean.cache;
|
||||
|
||||
import io.avaje.lang.Nullable;
|
||||
import io.ebean.meta.MetricVisitor;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
@@ -68,36 +69,27 @@ public interface ServerCache {
|
||||
/**
|
||||
* Return the number of entries in the cache.
|
||||
*/
|
||||
int size();
|
||||
default int size() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the hit ratio the cache is currently getting.
|
||||
*/
|
||||
default int hitRatio() {
|
||||
return getHitRatio();
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deprecated migrate to hitRatio().
|
||||
*/
|
||||
@Deprecated
|
||||
int getHitRatio();
|
||||
|
||||
/**
|
||||
* Return statistics for the cache.
|
||||
*
|
||||
* @param reset if true the statistics are reset.
|
||||
*/
|
||||
@Nullable
|
||||
default ServerCacheStatistics statistics(boolean reset) {
|
||||
return getStatistics(reset);
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deprecated migrate to statistics().
|
||||
*/
|
||||
@Deprecated
|
||||
ServerCacheStatistics getStatistics(boolean reset);
|
||||
|
||||
/**
|
||||
* Visit the metrics for the cache.
|
||||
*/
|
||||
@@ -108,6 +100,7 @@ public interface ServerCache {
|
||||
/**
|
||||
* Unwrap the underlying ServerCache.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
default <T> T unwrap(Class<T> cls) {
|
||||
return (T) this;
|
||||
}
|
||||
|
||||
@@ -69,13 +69,13 @@ public final class TenantAwareCache implements ServerCache {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getHitRatio() {
|
||||
return delegate.getHitRatio();
|
||||
public int hitRatio() {
|
||||
return delegate.hitRatio();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ServerCacheStatistics getStatistics(boolean reset) {
|
||||
return delegate.getStatistics(reset);
|
||||
public ServerCacheStatistics statistics(boolean reset) {
|
||||
return delegate.statistics(reset);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user