Class FuzzyMatcher.Builder<T>
java.lang.Object
cloud.opencode.base.string.match.FuzzyMatcher.Builder<T>
- Type Parameters:
T- the item type | 项目类型
- Enclosing class:
FuzzyMatcher<T>
Builder for FuzzyMatcher.
FuzzyMatcher 的构建器。
- Since:
- JDK 25, opencode-base-string V1.2.0
- Author:
- Leon Soo www.LeonSoo.com
-
Method Summary
Modifier and TypeMethodDescriptionAdds an item to the matcher.addAll(Collection<? extends T> items) Adds multiple items to the matcher.algorithm(FuzzyMatcher.MatchAlgorithm algorithm) Sets the matching algorithm.build()Builds the FuzzyMatcher.ignoreCase(boolean ignoreCase) Sets whether to ignore case.maxResults(int maxResults) Sets the maximum number of results.threshold(double threshold) Sets the similarity threshold (0.0 - 1.0).
-
Method Details
-
add
Adds an item to the matcher. 向匹配器添加项目。- Parameters:
item- the item to add | 要添加的项目- Returns:
- this builder | 此构建器
-
addAll
Adds multiple items to the matcher. 向匹配器添加多个项目。- Parameters:
items- the items to add | 要添加的项目- Returns:
- this builder | 此构建器
-
threshold
Sets the similarity threshold (0.0 - 1.0). 设置相似度阈值(0.0 - 1.0)。- Parameters:
threshold- the threshold | 阈值- Returns:
- this builder | 此构建器
-
maxResults
Sets the maximum number of results. 设置最大结果数。- Parameters:
maxResults- the max results | 最大结果数- Returns:
- this builder | 此构建器
-
ignoreCase
Sets whether to ignore case. 设置是否忽略大小写。- Parameters:
ignoreCase- true to ignore case | true表示忽略大小写- Returns:
- this builder | 此构建器
-
algorithm
Sets the matching algorithm. 设置匹配算法。- Parameters:
algorithm- the algorithm | 算法- Returns:
- this builder | 此构建器
-
build
Builds the FuzzyMatcher. 构建 FuzzyMatcher。- Returns:
- a new FuzzyMatcher | 新的 FuzzyMatcher
-