M3-Quellordneradapter korrigiert und leere PDF-Kandidaten zugelassen
This commit is contained in:
@@ -16,7 +16,7 @@ import java.util.Objects;
|
||||
* Fields:
|
||||
* <ul>
|
||||
* <li>{@code uniqueIdentifier} — human-readable name for logging and correlation (e.g. filename)</li>
|
||||
* <li>{@code fileSizeBytes} — enables early detection of corrupt/empty documents</li>
|
||||
* <li>{@code fileSizeBytes} — file size for metadata and tracing; may be zero for empty files (content evaluation happens later in AP-004)</li>
|
||||
* <li>{@code locator} — opaque reference passed through unchanged to the extraction adapter;
|
||||
* Domain and Application never interpret its value</li>
|
||||
* </ul>
|
||||
@@ -36,23 +36,23 @@ public record SourceDocumentCandidate(
|
||||
* Ensures all parameters are non-null and meaningful:
|
||||
* <ul>
|
||||
* <li>{@code uniqueIdentifier} must be non-null and non-empty</li>
|
||||
* <li>{@code fileSizeBytes} must be positive</li>
|
||||
* <li>{@code fileSizeBytes} must be non-negative (may be zero for empty files; content evaluation is AP-004)</li>
|
||||
* <li>{@code locator} must be non-null</li>
|
||||
* </ul>
|
||||
*
|
||||
* @param uniqueIdentifier non-null, non-empty identifier for logging and correlation
|
||||
* @param fileSizeBytes must be > 0
|
||||
* @param fileSizeBytes must be >= 0 (may be 0; content evaluation happens in AP-004)
|
||||
* @param locator non-null opaque locator; only adapters interpret its value
|
||||
* @throws NullPointerException if uniqueIdentifier or locator is null
|
||||
* @throws IllegalArgumentException if uniqueIdentifier is empty or fileSizeBytes <= 0
|
||||
* @throws IllegalArgumentException if uniqueIdentifier is empty or fileSizeBytes < 0
|
||||
*/
|
||||
public SourceDocumentCandidate {
|
||||
Objects.requireNonNull(uniqueIdentifier, "uniqueIdentifier must not be null");
|
||||
if (uniqueIdentifier.isEmpty()) {
|
||||
throw new IllegalArgumentException("uniqueIdentifier must not be empty");
|
||||
}
|
||||
if (fileSizeBytes <= 0) {
|
||||
throw new IllegalArgumentException("fileSizeBytes must be positive");
|
||||
if (fileSizeBytes < 0) {
|
||||
throw new IllegalArgumentException("fileSizeBytes must not be negative");
|
||||
}
|
||||
Objects.requireNonNull(locator, "locator must not be null");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user