Interface CustomAdditionalData

All Superinterfaces:
AdditionalData

@Incubating public interface CustomAdditionalData extends AdditionalData
Custom Additional data for a problem.

This class allows to access additional data via a custom type that was attached to a problem by using ProblemSpec.additionalData(Class, Action).

Since:
8.13
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> T
    get(Class<T> viewType)
    Returns an instance of the given type that accesses the additional data.

    Methods inherited from interface org.gradle.tooling.events.problems.AdditionalData

    getAsMap
  • Method Details

    • get

      <T> T get(Class<T> viewType)
      Returns an instance of the given type that accesses the additional data.
      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: List, Set, 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 Property) can be mapped to their corresponding allowed types, e.g. Property<String> getName() can be represented as String getName()
      Since:
      8.13