SparseLiveDocs.Builder (Lucene 10.5.1 core API)
Description: declaration: package: org.apache.lucene.util, class: SparseLiveDocs, class: Builder

Package org.apache.lucene.util

# Class SparseLiveDocs.Builder

java.lang.Object
org.apache.lucene.util.SparseLiveDocs.Builder

Enclosing class:
  `SparseLiveDocs`

public static final class SparseLiveDocs.Builder extends Object
Builder for creating SparseLiveDocs instances with optional pre-computed deleted count.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `SparseLiveDocs`
  `build()`
  Builds the SparseLiveDocs instance.
  `SparseLiveDocs.Builder`
  `withDeletedCount(int deletedCount)`
  Sets the pre-computed deleted document count, avoiding cardinality computation.

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

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

- ## Method Details

  - ### withDeletedCount

    public SparseLiveDocs.Builder withDeletedCount(int deletedCount)
    Sets the pre-computed deleted document count, avoiding cardinality computation.
    Parameters:
      `deletedCount` - the number of deleted documents
    Returns:
      this builder

  - ### build

    public SparseLiveDocs build()
    Builds the SparseLiveDocs instance.
    Returns:
      a new SparseLiveDocs instance
    Throws:
      `IllegalArgumentException` - if deletedCount is outside valid range [0, maxDoc]