Package org.gradle.util
Class NameMatcher
- java.lang.Object
-
- org.gradle.util.NameMatcher
-
@Deprecated public class NameMatcher extends java.lang.Object
Deprecated.Will be removed in Gradle 9.0.This class is only here to maintain binary compatibility with existing plugins.
-
-
Constructor Summary
Constructors Constructor Description NameMatcher()
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.String
find(java.lang.String pattern, java.util.Collection<java.lang.String> items)
Deprecated.Locates the best match for a camel case pattern in a collection.<T> T
find(java.lang.String pattern, java.util.Map<java.lang.String,? extends T> items)
Deprecated.Locates the best match for a camel case pattern in a key set of a map and returns the corresponding value.java.lang.String
formatErrorMessage(java.lang.String singularItemDescription, java.lang.Object container)
Deprecated.Returns a formatted error message describing why the pattern matching failed.java.util.Set<java.lang.String>
getCandidates()
Deprecated.Returns the potential matches, if any.java.util.Set<java.lang.String>
getMatches()
Deprecated.Returns all matches, when there were more than 1.
-
-
-
Method Detail
-
find
public <T> T find(java.lang.String pattern, java.util.Map<java.lang.String,? extends T> items)
Deprecated.Locates the best match for a camel case pattern in a key set of a map and returns the corresponding value.- Returns:
- The matching item if exactly 1 match found, null if no matches or multiple matches.
- See Also:
find(String, Collection)
-
find
public java.lang.String find(java.lang.String pattern, java.util.Collection<java.lang.String> items)
Deprecated.Locates the best match for a camel case pattern in a collection.The pattern is expanded to match on camel case and on kebab case strings. For example, the pattern
gBD
matches togradleBinaryDistribution
andgradle-binary-distribution
.The method will return
null
if the pattern is an empty string.If the target collection contains the pattern string then the method omits the pattern matching and returns the pattern.
- Returns:
- The match if exactly 1 match found, null if no matches or multiple matches.
-
getMatches
public java.util.Set<java.lang.String> getMatches()
Deprecated.Returns all matches, when there were more than 1.- Returns:
- The matches. Returns an empty set when there are no matches.
-
getCandidates
public java.util.Set<java.lang.String> getCandidates()
Deprecated.Returns the potential matches, if any.- Returns:
- The matches. Returns an empty set when there are no potential matches.
-
formatErrorMessage
public java.lang.String formatErrorMessage(java.lang.String singularItemDescription, java.lang.Object container)
Deprecated.Returns a formatted error message describing why the pattern matching failed.- Returns:
- The error message.
-
-