Stream.apex

  • Docs
  • Tutorials
Docs Menu
  • Streams
  • Methods
    • Creation Methods
    • Functions
    • Subscription Methods
    • Operation Methods
  • Subject

Functions Guide

Functions

create

Create from stream source

Stream s = (Stream)Stream.Funcs.create.run(new CustomSource());

ofData

Create from value

Stream s = (Stream)Stream.Funcs.ofData.run('abc');

throwError

Create from error

Stream s = (Stream)Stream.Funcs.throwError.run('error');

empty

Create an empty stream

Stream s = (Stream)Stream.Funcs.empty.run();

never

Create a stream that does not emit error or complete event.

Stream s = (Stream)Stream.Funcs.never.run();

fromData

Create a stream from a collection

Stream s = (Stream)Stream.Funcs.fromData.run(new List{ 1, 2, 3 });

with

Create a stream from values

Stream s = (Stream)Stream.Funcs.with.run(1, 2, 3);

range

Create a stream from ranges of values

Stream s = (Stream)Stream.Funcs.range.run(1, 4);

generate

Generate a stream with the Funcs

Stream s = (Stream)Stream.Funcs.generate.run(0, R.lt.apply(R.placeholder, 3), R.inc);

concat

Create a stream by concatenating other streams

Stream s = (Stream)Stream.Funcs.concat.run(new List{ Stream.of(1), Stream.of(2) });

Contribute on Github! Edit this section.