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.
Although its not recommended you can use a null
as an argument of this function. Remember using null is considered harmful!
value
- R: value that should be returned by the created function.
- type of the function argument.
- type of the function result.
Return
((T1) -> R)!: a function always returns the given value.