Class SampleNameFilter
java.lang.Object
io.prometheus.client.SampleNameFilter
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionReplacement for Java 8'sPredicate.and()for compatibility with Java versions < 8.restrictToNamesEqualTo(Predicate<String> filter, Collection<String> allowedNames) Helper method to compose a filter such that Sample names must match the existing filter and be in the list of allowedNames This should be used to implement thenames[]query parameter in HTTP exporters.Helper method to deserialize adelimiter-separated list of Strings into aList<String>.boolean
-
Field Details
-
ALLOW_ALL
-
-
Method Details
-
test
-
and
-
stringToList
-
restrictToNamesEqualTo
public static Predicate<String> restrictToNamesEqualTo(Predicate<String> filter, Collection<String> allowedNames) Helper method to compose a filter such that Sample names must- match the existing filter
- and be in the list of allowedNames
names[]query parameter in HTTP exporters.- Parameters:
filter- may be null, indicating that the resulting filter should just filter byallowedNames.allowedNames- may be null or empty, indicating thatfilteris returned unmodified.- Returns:
- a filter combining the exising
filterand theallowedNames, ornullif both parameters werenull.
-