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>

public static final class FuzzyMatcher.Builder<T> extends Object
Builder for FuzzyMatcher. FuzzyMatcher 的构建器。
Since:
JDK 25, opencode-base-string V1.2.0
Author:
Leon Soo www.LeonSoo.com
  • Method Details

    • add

      public FuzzyMatcher.Builder<T> add(T item)
      Adds an item to the matcher. 向匹配器添加项目。
      Parameters:
      item - the item to add | 要添加的项目
      Returns:
      this builder | 此构建器
    • addAll

      public FuzzyMatcher.Builder<T> addAll(Collection<? extends T> items)
      Adds multiple items to the matcher. 向匹配器添加多个项目。
      Parameters:
      items - the items to add | 要添加的项目
      Returns:
      this builder | 此构建器
    • threshold

      public FuzzyMatcher.Builder<T> threshold(double threshold)
      Sets the similarity threshold (0.0 - 1.0). 设置相似度阈值(0.0 - 1.0)。
      Parameters:
      threshold - the threshold | 阈值
      Returns:
      this builder | 此构建器
    • maxResults

      public FuzzyMatcher.Builder<T> maxResults(int maxResults)
      Sets the maximum number of results. 设置最大结果数。
      Parameters:
      maxResults - the max results | 最大结果数
      Returns:
      this builder | 此构建器
    • ignoreCase

      public FuzzyMatcher.Builder<T> ignoreCase(boolean ignoreCase)
      Sets whether to ignore case. 设置是否忽略大小写。
      Parameters:
      ignoreCase - true to ignore case | true表示忽略大小写
      Returns:
      this builder | 此构建器
    • algorithm

      public FuzzyMatcher.Builder<T> algorithm(FuzzyMatcher.MatchAlgorithm algorithm)
      Sets the matching algorithm. 设置匹配算法。
      Parameters:
      algorithm - the algorithm | 算法
      Returns:
      this builder | 此构建器
    • build

      public FuzzyMatcher<T> build()
      Builds the FuzzyMatcher. 构建 FuzzyMatcher。
      Returns:
      a new FuzzyMatcher | 新的 FuzzyMatcher