feat(ocr): add OcrStreamEvent sealed interface with Start/Page/Error/Done records
Defines the event types for NDJSON streaming OCR. Uses Java 21 sealed interface with record subtypes for exhaustive pattern matching in the consumer. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
package org.raddatz.familienarchiv.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public sealed interface OcrStreamEvent {
|
||||
|
||||
record Start(int totalPages) implements OcrStreamEvent {}
|
||||
|
||||
record Page(int pageNumber, List<OcrBlockResult> blocks) implements OcrStreamEvent {}
|
||||
|
||||
record Error(int pageNumber, String message) implements OcrStreamEvent {}
|
||||
|
||||
record Done(int totalBlocks, int skippedPages) implements OcrStreamEvent {}
|
||||
}
|
||||
Reference in New Issue
Block a user