Modifier and Type | Field and Description |
---|---|
static Function<Number,Float> |
Functions.FLOAT_VALUE
A function that returns the float value of a number.
|
static Function<Number,Integer> |
Functions.INT_VALUE
A function that returns the int value of a number.
|
static Function<Object,Boolean> |
Functions.IS_NULL
A function that returns true for null values and false for non-null values.
|
static Function<Object,Boolean> |
Functions.NON_NULL
A function that returns true for non-null values and false for null values.
|
static Function<Boolean,Boolean> |
Functions.NOT
Implements boolean not.
|
static Function<Object,String> |
Functions.TO_STRING
A function that applies
String.valueOf(java.lang.Object) to its argument. |
Modifier and Type | Method and Description |
---|---|
static <E> Function<Object,E> |
Functions.constant(E constant)
Returns a function that always returns the supplied constant value.
|
static <K,V> Function<K,V> |
Functions.forMap(Map<K,? extends V> map,
V defaultValue)
Returns a function which performs a map lookup with a default value.
|
static Function<Integer,Boolean> |
Functions.greaterThan(int target)
Returns a function that computes whether a value is greater than
target . |
static Function<Integer,Boolean> |
Functions.greaterThanEqual(int target)
Returns a function that computes whether a value is greater than or equal to
value . |
static <T> Function<T,T> |
Functions.identity()
Returns the identity function for type
T . |
static Function<Integer,Boolean> |
Functions.lessThan(int target)
Returns a function that computes whether a value is less than
target . |
static Function<Integer,Boolean> |
Functions.lessThanEqual(int target)
Returns a function that computes whether a value is less than or equal to
target . |
static <T,R> Function<Try<T>,Try<R>> |
Try.lift(Function<T,R> func)
Lifts
func , a function on values, to a function on tries. |
static <T> Function<T,String> |
Functions.prefix(String prefix)
Returns a function which returns its argument as a string with
prefix prepended. |
static <T> Function<T,String> |
Functions.suffix(String suffix)
Returns a function which returns its argument as a string with
suffix appended. |
Modifier and Type | Method and Description |
---|---|
<M> SignalView<M> |
SignalView.collect(Function<? super T,M> collector)
Creates a signal that maps the values emitted by this signal through
collector and
emits only the non-null values that are returned. |
<M> SignalView<M> |
AbstractSignal.collect(Function<? super T,M> collector) |
<S> Slot<S> |
Slot.compose(Function<S,T> f)
Returns a slot that maps values via
f and then passes them to this slot. |
SignalView<T> |
SignalView.filter(Function<? super T,Boolean> pred)
Creates a signal that emits a value only when the supplied filter function returns true.
|
SignalView<T> |
AbstractSignal.filter(Function<? super T,Boolean> pred) |
<S extends T> |
Slot.filtered(Function<? super S,Boolean> pred)
Returns a slot that is only notified when the signal to which this slot is connected emits a
value which causes
pred to return true. |
<M> ValueView<M> |
AbstractValue.flatMap(Function<? super T,? extends ValueView<M>> func) |
<M> ValueView<M> |
ValueView.flatMap(Function<? super T,? extends ValueView<M>> func)
Creates a value that flat maps (monadic binds) this value via a function.
|
<R> RFuture<R> |
RFuture.flatMap(Function<? super T,RFuture<R>> func)
Maps a successful result to a new result using
func when it arrives. |
abstract <R> Try<R> |
Try.flatMap(Function<? super T,Try<R>> func)
Maps successful tries through
func , passes failure through as is. |
<R> Try<R> |
Try.Success.flatMap(Function<? super T,Try<R>> func) |
<R> Try<R> |
Try.Failure.flatMap(Function<? super T,Try<R>> func) |
static <T,R> Function<Try<T>,Try<R>> |
Try.lift(Function<T,R> func)
Lifts
func , a function on values, to a function on tries. |
<M> SignalView<M> |
SignalView.map(Function<? super T,M> func)
Creates a signal that maps this signal via a function.
|
<M> SignalView<M> |
AbstractSignal.map(Function<? super T,M> func) |
<M> ValueView<M> |
AbstractValue.map(Function<? super T,M> func) |
<M> ValueView<M> |
ValueView.map(Function<? super T,M> func)
Creates a value that maps this value via a function.
|
abstract <R> Try<R> |
Try.map(Function<? super T,R> func)
Maps successful tries through
func , passees failure through as is. |
<R> Try<R> |
Try.Success.map(Function<? super T,R> func) |
<R> Try<R> |
Try.Failure.map(Function<? super T,R> func) |
<R> RFuture<R> |
RFuture.map(Function<? super T,R> func)
Maps the value of a successful result using
func upon arrival. |
abstract Try<T> |
Try.recover(Function<? super Throwable,T> func)
Maps failed tries through
func , passes success through as is. |
Try<T> |
Try.Success.recover(Function<? super Throwable,T> func) |
Try<T> |
Try.Failure.recover(Function<? super Throwable,T> func) |
RFuture<T> |
RFuture.recover(Function<? super Throwable,T> func)
Maps the value of a failed result using
func upon arrival. |
<R> RFuture<R> |
RFuture.transform(Function<Try<? super T>,Try<R>> func)
Transforms this future by mapping its result upon arrival.
|
RFuture<T> |
AbstractValue.when(Function<? super T,Boolean> cond) |
RFuture<T> |
ValueView.when(Function<? super T,Boolean> cond)
Returns a future which is completed with this value when the value meeds
cond . |
Copyright © 2017. All rights reserved.