@FunctionalInterface public interface DocumentExtractor<T>
| Modifier and Type | Interface and Description |
|---|---|
static interface |
DocumentExtractor.Builder<E>
Generic builder that can be used to build DocumentExtractor objects of common types.
|
| Modifier and Type | Method and Description |
|---|---|
static <E> DocumentExtractor.Builder<E> |
builder(@NotNull Class<E> elementType)
Creates and returns a new Builder that can be used to create DocumentExtractor objects
of the provided
elementType. |
T |
extract(@NotNull Wire wire,
long index)
Extracts a value of type T from the provided
wire and index or else null
if no value can be extracted. |
default DocumentExtractor<T> |
filter(@NotNull Predicate<? super T> predicate)
Creates and returns a new DocumentExtractor consisting of the elements of this DocumentExtractor that match
the provided
predicate. |
default <R> DocumentExtractor<R> |
map(@NotNull Function<? super T,? extends R> mapper)
Creates and returns a new DocumentExtractor consisting of the results (of type R) of applying the provided
mapper to the elements of this DocumentExtractor. |
default ToLongDocumentExtractor |
mapToLong(@NotNull ToLongFunction<? super T> mapper)
Creates and returns a new ToLongDocumentExtractor consisting of applying the provided
mapper to the elements of this DocumentExtractor. |
@Nullable T extract(@NotNull @NotNull Wire wire, long index) throws net.openhft.chronicle.core.io.InvalidMarshallableException
wire and index or else null
if no value can be extracted.
null may be returned if the queue was written with a method writer and there are messages in the
queue but of another type.
wire - to useindex - to usenullnet.openhft.chronicle.core.io.InvalidMarshallableExceptiondefault <R> DocumentExtractor<R> map(@NotNull @NotNull Function<? super T,? extends R> mapper)
mapper to the elements of this DocumentExtractor.
Values mapped to null are removed.
R - type to map tomapper - to applyNullPointerException - if the provided mapper is nulldefault ToLongDocumentExtractor mapToLong(@NotNull @NotNull ToLongFunction<? super T> mapper)
mapper to the elements of this DocumentExtractor.
Values mapped to Long.MIN_VALUE are removed.
mapper - to applyNullPointerException - if the provided mapper is nulldefault DocumentExtractor<T> filter(@NotNull @NotNull Predicate<? super T> predicate)
predicate.predicate - to apply to each element to determine if it
should be includedNullPointerException - if the provided predicate is nullstatic <E> DocumentExtractor.Builder<E> builder(@NotNull @NotNull Class<E> elementType)
elementType.E - element typeelementType - type of element to extractCopyright © 2023. All rights reserved.