Class DeprecatedCaptureNames
This class is internal and is hence not for public use. Its APIs are unstable and can change at any time.
-
Method Summary
Modifier and TypeMethodDescriptionstatic IncludeExcludetoSelector(Collection<String> names, String source, String replacement) Returns a selector matchingnames, ignoring every name that contains*or?, ornullwhen no name remains.static IncludeExcludetoSelectorOrEmpty(Collection<String> names, String source, String replacement) Returns a selector matchingnames, ignoring every name that contains*or?, or an empty selector when no name remains.
-
Method Details
-
toSelector
@Nullable public static IncludeExclude toSelector(@Nullable Collection<String> names, String source, @Nullable String replacement) Returns a selector matchingnames, ignoring every name that contains*or?, ornullwhen no name remains.The deprecated include-only settings match names literally, so a value containing a glob metacharacter only ever matched a name containing that character literally, which in practice matched nothing. Interpreting such a value as a glob pattern would silently widen what is captured, turning a value of
"*"that captured nothing into one that captures everything, including names holding credentials. Such values are ignored and logged instead.Because no remaining name contains a metacharacter,
IncludeExcludematches them literally, so the returned selector captures exactly what this setting captured for the names it keeps.nullis returned rather than an empty selector because an empty selector matches every name.- Parameters:
source- what configured the names, named in the warningreplacement- what selects names by glob pattern instead, ornullwhen there is no replacement forsource
-
toSelectorOrEmpty
public static IncludeExclude toSelectorOrEmpty(@Nullable Collection<String> names, String source, @Nullable String replacement) Returns a selector matchingnames, ignoring every name that contains*or?, or an empty selector when no name remains. SeetoSelector(java.util.Collection<java.lang.String>, java.lang.String, java.lang.String)for why such names are ignored.This is the variant for settings that always hold a selector rather than an optional one, so that a setting whose every value was ignored captures nothing.
-