@Immutable @Functional public interface UnaryFunction<INPUT,OUTPUT> extends FailableUnaryFunction<INPUT,OUTPUT,RuntimeException>
INPUT to an object of type OUTPUT.| Modifier and Type | Method and Description |
|---|---|
default <INITIAL_INPUT> |
after(@Nonnull UnaryFunction<? super INITIAL_INPUT,? extends INPUT> function)
Returns the composition of the given function followed by this function.
|
default <FINAL_OUTPUT> |
before(@Nonnull UnaryFunction<? super OUTPUT,? extends FINAL_OUTPUT> function)
Returns the composition of this function followed by the given function.
|
static <OUTPUT> @Nonnull UnaryFunction<Object,OUTPUT> |
constant(OUTPUT output)
Returns a function that always returns the given output.
|
default @Nonnull UnaryFunction<INPUT,OUTPUT> |
propagateNull()
Returns a new function based on this function that propagates null instead of evaluating it.
|
default @Nonnull UnaryFunction<INPUT,OUTPUT> |
replaceNull(OUTPUT defaultValue)
Returns a new function based on this function that returns the given default output for null.
|
static <KEY,VALUE> |
with(@Nonnull Map<? super KEY,? extends VALUE> map)
Returns a function that looks up the result in the given map or returns null if the input is not found in the map.
|
static <KEY,VALUE> |
with(@Nonnull Map<? super KEY,? extends VALUE> map,
VALUE defaultValue)
Returns a function that looks up the result in the given map or returns the given default value if the input is not found in the map.
|
after, before, compose, evaluate, suppressExceptions, suppressExceptions, suppressExceptions, suppressExceptions@Pure @Nonnull default <FINAL_OUTPUT> @Nonnull UnaryFunction<INPUT,FINAL_OUTPUT> before(@Nonnull @Nonnull UnaryFunction<? super OUTPUT,? extends FINAL_OUTPUT> function)
@Pure @Nonnull default <INITIAL_INPUT> @Nonnull UnaryFunction<INITIAL_INPUT,OUTPUT> after(@Nonnull @Nonnull UnaryFunction<? super INITIAL_INPUT,? extends INPUT> function)
@Pure @Nonnull default @Nonnull UnaryFunction<INPUT,OUTPUT> replaceNull(@Captured OUTPUT defaultValue)
FailableUnaryFunctionreplaceNull in interface FailableUnaryFunction<INPUT,OUTPUT,RuntimeException>@Pure @Nonnull default @Nonnull UnaryFunction<INPUT,OUTPUT> propagateNull()
FailableUnaryFunctionpropagateNull in interface FailableUnaryFunction<INPUT,OUTPUT,RuntimeException>@Pure @Nonnull static <KEY,VALUE> @Nonnull UnaryFunction<KEY,VALUE> with(@Nonnull @Nonnull Map<? super KEY,? extends VALUE> map, VALUE defaultValue)
@Pure @Nonnull static <KEY,VALUE> @Nonnull UnaryFunction<KEY,VALUE> with(@Nonnull @Nonnull Map<? super KEY,? extends VALUE> map)
@Pure @Nonnull static <OUTPUT> @Nonnull UnaryFunction<Object,OUTPUT> constant(@Captured OUTPUT output)
Copyright © 2017. All rights reserved.