gh-pages / com.nextfaze.devfun.function / FunctionItem

FunctionItem

interface FunctionItem (source)

Items are converted from FunctionDefinition at run-time via FunctionTransformer.

Implementers of this need to ensure a valid equals and hashCode implementation. Unless necessary, you should extend from convenience class SimpleFunctionItem that does this already.

Do not to include invoke in the equals/hashCode implementations as it is usually a non-comparable anonymous instance.

See Also

SimpleFunctionItem.equals

SimpleFunctionItem.hashCode

Properties

Name Summary
args open val args: FunctionArgs
Custom arguments for the invoke invocation. Otherwise arguments will be requested from an InstanceProvider.
category abstract val category: CategoryDefinition
The resolved category definition.
function abstract val function: FunctionDefinition
The original definition this item was derived from.
group open val group: CharSequence?
A “grouping” for this item.
invoke open val invoke: FunctionInvoke
Function to be invoked on click.
name open val name: CharSequence
The formatted display name.

Extension Properties

Name Summary
receiverClass val FunctionItem.receiverClass: KClass<*>
Get the receiver class for this function item.
receiverClassForInvocation val FunctionItem.receiverClassForInvocation: KClass<*>?
Get the receiver class for this function item if you intend to invoke it. That is, it will return null if the type isn’t needed.

Extension Functions

Name Summary
call fun FunctionItem.call(invoker: Invoker = devFun.get()): InvokeResult?
Convenience function for invoking a FunctionItem using the current devFun instance.
parameterInstances fun FunctionItem.parameterInstances(instanceProvider: InstanceProvider = devFun.instanceProviders): List<Any?>
Get the parameter instances for this function item for invocation.
receiverInstance fun FunctionItem.receiverInstance(instanceProvider: InstanceProvider = devFun.instanceProviders): Any?
Get the receiver instance for this function item to be used for invocation.

Inheritors

Name Summary
ExceptionFunctionItem class ExceptionFunctionItem : FunctionItem
SimpleFunctionItem open class SimpleFunctionItem : FunctionItem
Convenience class for FunctionItem to extend from, providing standard equals and hashCode implementations.