public class ImportBatchBuilder
extends java.lang.Object
Constructor and Description |
---|
ImportBatchBuilder() |
Modifier and Type | Method and Description |
---|---|
util.object.Either<Error,java.util.List<ImportInput>> |
build(ImportRequest... requestsToBatch)
Maps the given
ImportRequest s to ImportInput s. |
public util.object.Either<Error,java.util.List<ImportInput>> build(ImportRequest... requestsToBatch)
ImportRequest
s to ImportInput
s.
If the given array is null
or empty, or if it only contains
null
elements, an empty list will be returned. Otherwise any
null
elements are filtered out, while the remaining non-null
requests are validated
. If validation fails for some of them, an Error
will
be returned that details the detected validation errors for each request
that didn't pass validation. On the other hand, if all the non-null
requests pass validation, they're turned into ImportInput
s
and returned in a list.requestsToBatch
- the requests that will be part of the batch.ImportInput
for each successfully validated
request or an error if validation failed.