public final class StatsUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
findLowestTier(java.lang.String[] tiers)
Find the lowest tier from a list of tier.
|
static <T extends java.lang.Enum<T>> |
findOperationStatisticOnChildren(java.lang.Object context,
java.lang.Class<T> type,
java.lang.String statName)
Find an operation statistic attached (as a children) to this context that matches the statistic name and type
|
static <T> java.util.Optional<T> |
findStatisticOnDescendants(java.lang.Object context,
java.lang.String tag,
java.lang.String statName)
Search for a statistic on the descendant of the context that matches the tag and statistic name.
|
static <T> java.util.Optional<T> |
findStatisticOnDescendants(java.lang.Object context,
java.lang.String discriminator,
java.lang.String tag,
java.lang.String statName)
Search for a statistic on the descendant of the context that matches the tag and statistic name.
|
static java.lang.String[] |
findTiers(Cache<?,?> cache)
Find the list of tiers of a cache.
|
static <T extends java.lang.Enum<T>> |
hasOperationStat(java.lang.Object rootNode,
java.lang.Class<T> statisticType,
java.lang.String statName) |
static <any> |
hasProperty(java.lang.String key,
java.lang.String value) |
static <any> |
hasTag(java.lang.String tag) |
static void |
registerClearNotification(java.lang.String alias,
Cache<?,?> cache,
java.util.function.Consumer<java.lang.String> cacheClear) |
public static <any> hasTag(java.lang.String tag)
public static <any> hasProperty(java.lang.String key, java.lang.String value)
public static <T> java.util.Optional<T> findStatisticOnDescendants(java.lang.Object context, java.lang.String discriminator, java.lang.String tag, java.lang.String statName)
T
- type of the statistic that will be returnedcontext
- the context of the querydiscriminator
- a filter on the discriminator propertytag
- the tag we are looking forstatName
- statistic namejava.lang.RuntimeException
- when more than one matching statistic is foundpublic static <T> java.util.Optional<T> findStatisticOnDescendants(java.lang.Object context, java.lang.String tag, java.lang.String statName)
T
- type of the statistic that will be returnedcontext
- the context of the querytag
- the tag we are looking forstatName
- statistic namejava.lang.RuntimeException
- when more than one matching statistic is foundpublic static <T extends java.lang.Enum<T>> OperationStatistic<T> findOperationStatisticOnChildren(java.lang.Object context, java.lang.Class<T> type, java.lang.String statName)
T
- type of the operation statistic contentcontext
- the context of the querytype
- type of the operation statisticstatName
- statistic namejava.lang.RuntimeException
- if 0 or more than 1 result is foundpublic static java.lang.String[] findTiers(Cache<?,?> cache)
cache
- the context for looking for tiersjava.lang.RuntimeException
- if not tiers are found or if tiers have multiple tagspublic static java.lang.String findLowestTier(java.lang.String[] tiers)
tiers
- all tierspublic static <T extends java.lang.Enum<T>> boolean hasOperationStat(java.lang.Object rootNode, java.lang.Class<T> statisticType, java.lang.String statName)
public static void registerClearNotification(java.lang.String alias, Cache<?,?> cache, java.util.function.Consumer<java.lang.String> cacheClear)