Class StreamFirst

All Implemented Interfaces:
ZeroLengthBehaviourI, ZeroLengthBehaviourI.DefaultZeroLengthBehaviourI, JepComponent, PostfixMathCommandI, Serializable

Returns the first element from a stream. Uses the Stream.findFirst() methods. By default, if the stream is empty, an exception is thrown, but the behaviour can be configured using the methods of the ZeroLengthBehaviourI interface.

See StreamFirstOr for a variant that returns the first element or a default value if the stream is empty.

See Also:
  • Constructor Details

    • StreamFirst

      public StreamFirst()
  • Method Details