Interface ElementEncoder.EncodeProcessor<E,C>

Type Parameters:
E - the type of element
C - the type of collection
Enclosing interface:
ElementEncoder<E,T>

public static interface ElementEncoder.EncodeProcessor<E,C>
An interface for processing elements of the collection.
  • Method Details

    • encodeElement

      @NotNull <O> @NotNull dev.siroshun.jfun.result.Result<O,EncodeError> encodeElement(@NotNull @NotNull Out<O> out, @UnknownNullability E element)
      Encodes an element to the provided Out.
      Type Parameters:
      O - the type of the output destination
      Parameters:
      out - the Out for writing the encoded element
      element - the element to encode to the Out
      Returns:
      a result containing null if the operation succeeded, or a EncodeError if the operation failed
    • toIterator

      @NotNull @NotNull Iterator<E> toIterator(@UnknownNullability C input)
      Creates an Iterator from ElementEncoder.EncodeProcessor for encoding elements.
      Parameters:
      input - the object to encode
      Returns:
      the Iterator of elements