Package io.opentelemetry.sdk.internal
Class GlobUtil
- java.lang.Object
-
- io.opentelemetry.sdk.internal.GlobUtil
-
public final class GlobUtil extends java.lang.Object
Utilities for glob pattern matching.This class is internal and is hence not for public use. Its APIs are unstable and can change at any time.
-
-
Constructor Summary
Constructors Modifier Constructor Description private
GlobUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.function.Predicate<java.lang.String>
toGlobPatternPredicate(java.lang.String globPattern)
Return a predicate that returnstrue
if a string matches theglobPattern
.private static java.util.regex.Pattern
toRegexPattern(java.lang.String globPattern)
Transform theglobPattern
to a regex by converting*
to.*
,?
to.
, and escaping other regex special characters.
-
-
-
Method Detail
-
toGlobPatternPredicate
public static java.util.function.Predicate<java.lang.String> toGlobPatternPredicate(java.lang.String globPattern)
Return a predicate that returnstrue
if a string matches theglobPattern
.globPattern
may contain the wildcard characters*
and?
with the following matching criteria:*
matches 0 or more instances of any character?
matches exactly one instance of any character
-
toRegexPattern
private static java.util.regex.Pattern toRegexPattern(java.lang.String globPattern)
Transform theglobPattern
to a regex by converting*
to.*
,?
to.
, and escaping other regex special characters.
-
-