public final class DocumentExtractorBuilder<E> extends Object implements DocumentExtractor.Builder<E>
| Constructor and Description |
|---|
DocumentExtractorBuilder(@NotNull Class<E> elementType) |
| Modifier and Type | Method and Description |
|---|---|
@NotNull DocumentExtractor<E> |
build() |
<I> DocumentExtractor.Builder<E> |
withMethod(@NotNull Class<I> interfaceType,
@NotNull BiConsumer<? super I,? super E> methodReference)
Specifies an
interfaceType that was previously used to write messages of type E using
a method writer via invocations of the provided methodReference. |
DocumentExtractor.Builder<E> |
withReusing(@NotNull Supplier<? extends E> supplier)
Specifies a
supplier of element that shall be reused when extracting elements from excerpts. |
DocumentExtractor.Builder<E> |
withThreadConfinedReuse()
Specifies that only one reuse object, confined to the first using thread, shall be reused.
|
@NotNull public DocumentExtractor.Builder<E> withReusing(@NotNull @NotNull Supplier<? extends E> supplier)
DocumentExtractor.Buildersupplier of element that shall be reused when extracting elements from excerpts.
By default, thread local reuse objects are created on demand but this can be changed by means of the
DocumentExtractor.Builder.withThreadConfinedReuse() method.
The provided supplier must provide distinct objects on each invocation. This can be accomplished
, for example, by referencing Foo:new.
withReusing in interface DocumentExtractor.Builder<E>supplier - to call when reuse object are needed (non-null)@NotNull public DocumentExtractor.Builder<E> withThreadConfinedReuse()
DocumentExtractor.Builder
The DocumentExtractor is guaranteed to prevent accidental concurrent thread access by throwing
an IllegalStateException if accessed by a foreign thread.
withThreadConfinedReuse in interface DocumentExtractor.Builder<E>@NotNull public <I> DocumentExtractor.Builder<E> withMethod(@NotNull @NotNull Class<I> interfaceType, @NotNull @NotNull BiConsumer<? super I,? super E> methodReference)
DocumentExtractor.BuilderinterfaceType that was previously used to write messages of type E using
a method writer via invocations of the provided methodReference.
The provided methodReference must be a true method reference (e.g. Greeting:message)
or a corresponding lambda expression
(e.g. (Greeting greeting, String msg) -> greeting.message(m)) ) or else the
result is undefined.
withMethod in interface DocumentExtractor.Builder<E>I - interface typeinterfaceType - interface that has at least one method that takes a single
argument parameter of type EmethodReference - connecting the interface type to a method that takes a single
argument parameter of type E@NotNull public @NotNull DocumentExtractor<E> build()
build in interface net.openhft.chronicle.core.util.Builder<DocumentExtractor<E>>Copyright © 2023. All rights reserved.