sdk-common / com.tomtom.online.sdk.common.functional / Function2 / constant

constant

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

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

Although its not recommended you can use a null as an argument of this function. Remember using null is considered harmful!

Parameters

value - R: value that should be returned by the created function.

- type of the first argument of the function.

- type of the second argument of the function.

- type of the function result.

Return
((T1, T2) -> R)!: a function always returns the given value.