Stay organized with collections
Save and categorize content based on your preferences.
InspectionCompanionProvider
interface InspectionCompanionProvider
An interface for services that can provide inspection companions for a class.
Summary
Public methods
provide
abstract fun <T : Any!> provide(cls: Class<T>): InspectionCompanion<T>?
Provide an InspectionCompanion
for the supplied class. Implementing classes must not cache companion instances, and should instantiate a new one for each request.
Parameters |
cls |
Class<T>: A Class representing the inspectable type This value cannot be null . |
<T> |
The type to find the companion for |
Return |
InspectionCompanion<T>? |
The inspection companion for the supplied type This value may be null . |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# InspectionCompanionProvider\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nInspectionCompanionProvider\n===========================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/view/inspector/InspectionCompanionProvider \"View this page in Java\") \n\n```\ninterface InspectionCompanionProvider\n```\n\n|---------------------------------------------------------|\n| [android.view.inspector.InspectionCompanionProvider](#) |\n\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known Direct Subclasses [StaticInspectionCompanionProvider](/reference/kotlin/android/view/inspector/StaticInspectionCompanionProvider) |-----------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------| | [StaticInspectionCompanionProvider](/reference/kotlin/android/view/inspector/StaticInspectionCompanionProvider) | An inspection companion provider that finds companions as inner classes or generated code. | |\n\nAn interface for services that can provide inspection companions for a class.\n\nSummary\n-------\n\n| Public methods ||\n|----------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [InspectionCompanion](/reference/kotlin/android/view/inspector/InspectionCompanion)\\\u003cT\\\u003e? | [provide](#provide(java.lang.Class))`(`cls:` `[Class](../../../java/lang/Class.html#)\u003cT\u003e`)` Provide an [InspectionCompanion](/reference/kotlin/android/view/inspector/InspectionCompanion) for the supplied class. |\n\nPublic methods\n--------------\n\n### provide\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun \u003cT : Any!\u003e provide(cls: Class\u003cT\u003e): InspectionCompanion\u003cT\u003e?\n```\n\nProvide an [InspectionCompanion](/reference/kotlin/android/view/inspector/InspectionCompanion) for the supplied class. Implementing classes must not cache companion instances, and should instantiate a new one for each request.\n\n| Parameters ||\n|-------|--------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `cls` | [Class](../../../java/lang/Class.html#)\\\u003cT\\\u003e: A [Class](../../../java/lang/Class.html#) representing the inspectable type This value cannot be `null`. |\n| `\u003cT\u003e` | The type to find the companion for |\n\n| Return ||\n|-----------------------------------------------------------------------------------------|--------------------------------------------------------------------------|\n| [InspectionCompanion](/reference/kotlin/android/view/inspector/InspectionCompanion)\u003cT\u003e? | The inspection companion for the supplied type This value may be `null`. |"]]