public final class When<I,O> extends Object implements Fn<I,O>
Constructor and Description |
---|
When(Predicate<? super I> condition,
Fn<? super I,? extends O> fn) |
public Fn<I,O> orElse(O other)
other
- The value to return of the condition fails.Fn
for the ternary expression
condition(v) ? fn(v) : other
public Fn<I,O> orElse(Fn<? super I,? extends O> otherFn)
otherFn
- The function to apply if the condition fails.Fn
for the ternary expression
condition(v) ? fn(v) : otherFn(v)
Copyright © 2016. All Rights Reserved.