FunctionAccessorMetadata

data class FunctionAccessorMetadata<P, out R>(val functionKind: FunctionKind, val accessor: FunctionAccessor<P, R>, val supportedType: Class<*>, val supportedTopics: Set<NamedAggregate>, val firstParameterKind: FirstParameterKind, val injectParameters: Array<InjectParameter>) : FunctionInfo, NamedBoundedContext

Metadata describing a message function's properties and access patterns.

Contains all the information needed to invoke a message function reflectively, including supported types, topics, parameter kinds, and injection requirements.

Parameters

P

The processor type

R

The return type

Constructors

Link copied to clipboard
constructor(functionKind: FunctionKind, accessor: FunctionAccessor<P, R>, supportedType: Class<*>, supportedTopics: Set<NamedAggregate>, firstParameterKind: FirstParameterKind, injectParameters: Array<InjectParameter>)

Properties

Link copied to clipboard

The function accessor for invocation

Link copied to clipboard
open override val contextName: String

The bounded context name that this function belongs to.

Link copied to clipboard

How the first parameter should be extracted

Link copied to clipboard
open override val functionKind: FunctionKind

The kind of function (COMMAND, EVENT, etc.)

Link copied to clipboard

The number of injectable parameters.

Link copied to clipboard

Array of parameters that need dependency injection

Link copied to clipboard
open override val name: String

The name of the function/method.

Link copied to clipboard
open override val processorName: String

The name of the processor class.

Link copied to clipboard

The class of the processor.

Link copied to clipboard

The set of supported named aggregates

Link copied to clipboard

The class of supported message bodies

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

Checks equality based on the accessor, since that's the unique identifier.

Link copied to clipboard

Extracts the first argument for function invocation based on the parameter kind.

Link copied to clipboard
fun NamedBoundedContext.getContextAlias(boundedContext: BoundedContext? = MetadataSearcher.metadata.contexts[contextName]): String
Link copied to clipboard

Gets the context alias prefix for this bounded context.

Link copied to clipboard
open override fun hashCode(): Int

Returns hash code based on the accessor.

Link copied to clipboard
open fun isEmpty(): Boolean
Link copied to clipboard
Link copied to clipboard
open fun isSameFunction(functionInfo: FunctionInfo): Boolean
Link copied to clipboard

Checks if a function matches the criteria specified by this NamedFunctionInfo. Used to determine if a wait strategy should be notified about a specific function execution. Returns true if all specified criteria (context, processor, name) match or are not specified.

Link copied to clipboard

Converts a function accessor metadata into after-command function metadata.

Link copied to clipboard

Converts FunctionAccessorMetadata to a MessageFunctionAccessor. Creates either a SimpleMessageFunctionAccessor or InjectableMessageFunctionAccessor based on whether the function has injectable parameters.

Link copied to clipboard
open override fun toString(): String

Returns a string representation of this metadata.

Link copied to clipboard
fun FunctionInfo.toWaitSignal(id: String, waitCommandId: String, commandId: String, aggregateId: AggregateId, stage: CommandStage, isLastProjection: Boolean = false, aggregateVersion: Int? = null, errorCode: String = ErrorCodes.SUCCEEDED, errorMsg: String = ErrorCodes.SUCCEEDED_MESSAGE, bindingErrors: List<BindingError> = emptyList(), result: Map<String, Any> = emptyMap(), commands: List<String> = listOf(), signalTime: Long = System.currentTimeMillis()): WaitSignal