sdk-common / com.tomtom.online.sdk.common.functional / Function1

Function1

@FunctionalInterface interface Function1<A : Any!, R : Any!> : Serializable

Represents a function with a single argument.

Properties

serialVersionUID

static val serialVersionUID: Long

Functions

andThen

open fun <R2 : Any!> andThen(after: (in R) -> out R2): ((A) -> R2)!

Returns a composed function that first applies this function to the given input and then applies the function passed as after to the result.

apply

abstract fun apply(value: A): R

Applies this function to the given argument.

compose

open fun <A2 : Any!> compose(before: (in A2) -> out A): ((A2) -> R)!

Returns a composed function that first applies the before function and then applies itself to the result.

constant

open static fun <T1 : Any!, R : Any!> constant(value: R): ((T1) -> R)!

Returns a function that always returns the constant regardless of the passed arguments.

identity

open static fun <T : Any!> identity(): ((T) -> T)!

Returns a function that always returns its input argument.

liftTry

open static fun <L : Any!, R : Any!> liftTry(partial: (in L) -> out R): ((L) -> Try<R>!)!

Lifts given partial into a total function that returns a Try result.