get
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:
- Simple types: String, primitives and their wrappers (Integer, Boolean, etc.)
- Collections: java.util.List, java.util.Set, java.util.Map
- Composites: Types composed of the above allowed types
- 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 asString getName()