PrefixCodedTerms.Builder (Lucene 10.5.0 core API)
Description: declaration: package: org.apache.lucene.index, class: PrefixCodedTerms, class: Builder

Package org.apache.lucene.index

# Class PrefixCodedTerms.Builder

java.lang.Object
org.apache.lucene.index.PrefixCodedTerms.Builder

Enclosing class:
  `PrefixCodedTerms`

public static class PrefixCodedTerms.Builder extends Object
Builds a PrefixCodedTerms: call add repeatedly, then finish.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Builder()`
  Sole constructor.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `add(String field, BytesRef bytes)`
  add a term.
  `void`
  `add(Term term)`
  add a term
  `PrefixCodedTerms`
  `finish()`
  return finalized form

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

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

- ## Constructor Details

  - ### Builder

    public Builder()
    Sole constructor.

- ## Method Details

  - ### add

    public void add(Term term)
    add a term

  - ### add

    public void add(String field, BytesRef bytes)
    add a term. This fully consumes in the incoming `BytesRef`.

  - ### finish

    public PrefixCodedTerms finish()
    return finalized form