Interface ElementDecoder.DecodeProcessor<E,C>
- Type Parameters:
E- the type of the elementC- the type of the collection to decode elements to
- Enclosing interface:
ElementDecoder<E,R>
public static interface ElementDecoder.DecodeProcessor<E,C>
An interface to processing elements of the collection.
-
Method Summary
Modifier and TypeMethodDescription@NotNull dev.siroshun.jfun.result.Result<Void, DecodeError> acceptElement(C identity, @UnknownNullability E element) Accepts the element to the identity object ofElementDecoder.DecodeProcessor.Creates aElementDecoder.DecodeProcessorfor an identity ofIn.readList(Object, java.util.function.BiFunction).@NotNull dev.siroshun.jfun.result.Result<E, DecodeError> decodeElement(@NotNull In in) Decodes an element from the providedIn.finalizeIdentity(C identity) Finalizes the identity object ofElementDecoder.DecodeProcessor.
-
Method Details
-
decodeElement
@NotNull @NotNull dev.siroshun.jfun.result.Result<E,DecodeError> decodeElement(@NotNull @NotNull In in) Decodes an element from the providedIn.- Parameters:
in- theInfor reading the element to decode- Returns:
- a result containing the decoded element, or a
DecodeErrorif the operation failed
-
createIdentity
Creates aElementDecoder.DecodeProcessorfor an identity ofIn.readList(Object, java.util.function.BiFunction).- Returns:
- a
ElementDecoder.DecodeProcessorfor an identity ofIn.readList(Object, java.util.function.BiFunction)
-
acceptElement
@NotNull @NotNull dev.siroshun.jfun.result.Result<Void,DecodeError> acceptElement(@NotNull C identity, @UnknownNullability E element) Accepts the element to the identity object ofElementDecoder.DecodeProcessor.- Parameters:
identity- the identity objectelement- the element- Returns:
- the
Resultof accepting the element
-
finalizeIdentity
Finalizes the identity object ofElementDecoder.DecodeProcessor.- Parameters:
identity- the identity object- Returns:
- the final
ElementDecoder.DecodeProcessorobject
-