T
- Data type of element in this value@FunctionalInterface public interface Value<T> extends SealedOr<T>, java.lang.Iterable<T>, org.reactivestreams.Publisher<T>
Modifier and Type | Method and Description |
---|---|
default Function0<T> |
asSupplier(T alt) |
default <R,A> R |
collect(java.util.stream.Collector<? super T,A,R> collector) |
default T |
fold(Monoid<T> reducer) |
default void |
forEach(java.util.function.Consumer<? super T> c) |
default ReactiveSeq<T> |
generate(T alt) |
default boolean |
isPresent() |
default ReactiveSeq<T> |
iterate(java.util.function.UnaryOperator<T> fn,
T alt)
Use the value stored in this Value to seed a Stream generated from the provided function
|
default java.util.Iterator<T> |
iterator() |
default java.lang.String |
mkString()
Returns the class name and the name of the subclass, if there is any value, the value is showed between square brackets.
|
default ValueSubscriber<T> |
newSubscriber() |
default NonEmptyList<T> |
nonEmptyList(T alt) |
default NonEmptyList<T> |
nonEmptyListGet(java.util.function.Supplier<T> alt) |
default T |
orElse(T alt) |
default T |
orElseGet(java.util.function.Supplier<? extends T> s) |
default void |
print(java.io.PrintStream str)
Write each element within this Folds in turn to the supplied PrintStream
|
default void |
print(java.io.PrintWriter writer)
Write each element within this Folds in turn to the supplied PrintWriter
|
default void |
printErr()
Print each value in this Folds to the error console in turn (left-to-right)
|
default void |
printOut()
Print each value in this Folds to the console in turn (left-to-right)
|
default ReactiveSeq<T> |
stream() |
default void |
subscribe(org.reactivestreams.Subscriber<? super T> sub) |
default <ST> Either<ST,T> |
toEither(ST secondary)
Convert to an Xor where the left value will be used if no right value is present
|
default LazyEither<java.lang.Throwable,T> |
toLazyEither() |
default <RT> LazyEither<T,RT> |
toLeft(T alt)
Lazily convert this Value to an Either.left instance
|
default Maybe<T> |
toMaybe() |
default Option<T> |
toOption() |
default java.util.Optional<T> |
toOptional() |
default <LT> LazyEither<LT,T> |
toRight(T alt)
Lazily convert this Value to an Either.right instance
|
default Try<T,java.lang.Throwable> |
toTry() |
default <X extends java.lang.Throwable> |
toTry(java.lang.Class<X>... classes)
Convert this Value to a Try that will catch the provided exception types on subsequent operations
|
default <X extends java.lang.Throwable> |
toTry(X throwable) |
default <R> R |
transform(java.util.function.Function<? super Value<? super T>,? extends R> fn) |
default NonEmptyList<T> nonEmptyList(T alt)
default NonEmptyList<T> nonEmptyListGet(java.util.function.Supplier<T> alt)
default boolean isPresent()
default java.util.Iterator<T> iterator()
iterator
in interface java.lang.Iterable<T>
default ValueSubscriber<T> newSubscriber()
default void subscribe(org.reactivestreams.Subscriber<? super T> sub)
subscribe
in interface org.reactivestreams.Publisher<T>
default <R> R transform(java.util.function.Function<? super Value<? super T>,? extends R> fn)
default ReactiveSeq<T> stream()
default <ST> Either<ST,T> toEither(ST secondary)
secondary
- Value to use in case no right value is presentdefault LazyEither<java.lang.Throwable,T> toLazyEither()
default <LT> LazyEither<LT,T> toRight(T alt)
default <RT> LazyEither<T,RT> toLeft(T alt)
default <X extends java.lang.Throwable> Try<T,X> toTry(X throwable)
throwable
- Exception to use if this Value is zerodefault Try<T,java.lang.Throwable> toTry()
default <X extends java.lang.Throwable> Try<T,X> toTry(java.lang.Class<X>... classes)
classes
- Exception classes to catch on subsequent operationsdefault java.util.Optional<T> toOptional()
default java.lang.String mkString()
default void print(java.io.PrintStream str)
str
- PrintStream to tell todefault void print(java.io.PrintWriter writer)
writer
- PrintWriter to tell todefault void printOut()
default void printErr()
default <R,A> R collect(java.util.stream.Collector<? super T,A,R> collector)
default void forEach(java.util.function.Consumer<? super T> c)
forEach
in interface java.lang.Iterable<T>
default ReactiveSeq<T> iterate(java.util.function.UnaryOperator<T> fn, T alt)
fn
- Function to generate a Streamdefault ReactiveSeq<T> generate(T alt)