NormalizeCharMap.Builder (Lucene 10.5.0 common API)
Description: declaration: package: org.apache.lucene.analysis.charfilter, class: NormalizeCharMap, class: Builder

Package org.apache.lucene.analysis.charfilter

# Class NormalizeCharMap.Builder

java.lang.Object
org.apache.lucene.analysis.charfilter.NormalizeCharMap.Builder

Enclosing class:
  `NormalizeCharMap`

public static class NormalizeCharMap.Builder extends Object
Builds an NormalizeCharMap.

Call add() until you have added all the mappings, then call build() to get a NormalizeCharMap

WARNING: This API is experimental and might change in incompatible ways in the next release.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Builder()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `add(String match, String replacement)`
  Records a replacement to be applied to the input stream.
  `NormalizeCharMap`
  `build()`
  Builds the NormalizeCharMap; call this once you are done calling `add(java.lang.String, java.lang.String)`.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### Builder

    public Builder()

- ## Method Details

  - ### add

    public void add(String match, String replacement)
    Records a replacement to be applied to the input stream. Whenever `singleMatch` occurs in the input, it will be replaced with `replacement`.
    Parameters:
      `match` - input String to be replaced
      `replacement` - output String
    Throws:
      `IllegalArgumentException` - if `match` is the empty string, or was already previously added

  - ### build

    public NormalizeCharMap build()
    Builds the NormalizeCharMap; call this once you are done calling `add(java.lang.String, java.lang.String)`.