findModel

@Nullable
abstract fun <T> findModel(modelType: Class<T>): T(source)
@Nullable
abstract fun <T> findModel(target: Model, modelType: Class<T>): T(source)

Fetches a snapshot of the model of the given type, if available.

See getModel for more details.

Return

The model, or null if not present.

Parameters

modelType

The model type.

<T>

The model type.


@Nullable
abstract fun <T, P> findModel(modelType: Class<T>, parameterType: Class<P>, parameterInitializer: Action<in P>): T(source)

Fetches a snapshot of the model of the given type using the given parameter, if available.

See getModel for more details.

Return

The model.

Since

4.4

Parameters

modelType

The model type.

<T>

The model type.

parameterType

The parameter type.

<P>

The parameter type.

parameterInitializer

Action to configure the parameter


@Nullable
abstract fun <T, P> findModel(target: Model, modelType: Class<T>, parameterType: Class<P>, parameterInitializer: Action<in P>): T(source)

Fetches a snapshot of the model of the given type for the given element using the given parameter, if available.

See getModel for more details.

Return

The model.

Since

4.4

Parameters

target

The target element, usually a project.

modelType

The model type.

<T>

The model type.

parameterType

The parameter type.

<P>

The parameter type.

parameterInitializer

Action to configure the parameter