get

abstract fun <T> get(viewType: Class<T>): T(source)

Returns an instance of the given type that accesses the additional data.

Since

8.13

Parameters

viewType

the view type of the additional data

This represents the interface or class through which you want to access the underlying data. The system will return an implementation of this type that provides a specific "view" of the data, allowing for type-safe access to underlying data. The view type must be compatible with the actual data structure.

Limitations of the view type:

  • Allowed types: Only specific types are supported:
  • Provider API mapping (Provider API types are not allowed in view types): Provider API types (such as org.gradle.api.provider.Property) can be mapped to their corresponding allowed types, e.g. Property<String> getName() can be represented as String getName()