DefaultIfEmptyStreamTransformer<S> class

Emit items from the source Stream, or a single default item if the source Stream emits nothing.

Example

Stream.empty()
  .transform(DefaultIfEmptyStreamTransformer(10))
  .listen(print); // prints 10
Inheritance

Constructors

DefaultIfEmptyStreamTransformer(S defaultValue)
Constructs a StreamTransformer which either emits from the source Stream, or just a defaultValue if the source Stream emits nothing.

Properties

defaultValue → S
The event that should be emitted if the source Stream is empty
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

bind(Stream<S> stream) Stream<S>
Transforms the provided stream.
override
cast<RS, RT>() StreamTransformer<RS, RT>
Provides a StreamTransformer<RS, RT> view of this stream transformer.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited