Stay organized with collections
Save and categorize content based on your preferences.
OfField
interface OfField<F : TypeDescriptor.OfField<F>!> : TypeDescriptor
Known Direct Subclasses
Class |
Instances of the class represent classes and interfaces in a running Java application.
|
|
An entity that has a field type descriptor. Field descriptors conforming to JVMS {@jvms 4.3.2} can be described
Summary
Public methods |
abstract F |
Return a descriptor for the array type whose component type is described by this descriptor
|
abstract F |
If this field descriptor describes an array type, return a descriptor for its component type, otherwise return null .
|
abstract Boolean |
Does this field descriptor describe an array type?
|
abstract Boolean |
Does this field descriptor describe a primitive type (including void.)
|
Inherited functions |
From class TypeDescriptor
String! |
descriptorString()
Returns the descriptor string for this TypeDescriptor object. If this TypeDescriptor object can be described in nominal form, then this method returns a type descriptor as specified in JVMS {@jvms 4.3}. The result descriptor string can be used to produce a java.lang.constant.ConstantDesc nominal descriptor . Otherwise, the result string is not a type descriptor. No java.lang.constant.ConstantDesc nominal descriptor can be produced from the result string.
|
|
Public methods
arrayType
abstract fun arrayType(): F
Return a descriptor for the array type whose component type is described by this descriptor
Return |
F |
the descriptor for the array type |
componentType
abstract fun componentType(): F
If this field descriptor describes an array type, return a descriptor for its component type, otherwise return null
.
Return |
F |
the component type, or null if this field descriptor does not describe an array type |
isArray
abstract fun isArray(): Boolean
Does this field descriptor describe an array type?
Return |
Boolean |
whether this field descriptor describes an array type |
isPrimitive
abstract fun isPrimitive(): Boolean
Does this field descriptor describe a primitive type (including void.)
Return |
Boolean |
whether this field descriptor describes a primitive type |
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,["# TypeDescriptor.OfField\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nOfField\n=======\n\n```\ninterface OfField\u003cF : TypeDescriptor.OfField\u003cF\u003e!\u003e : TypeDescriptor\n```\n\n|----------------------------------------------|\n| [java.lang.invoke.TypeDescriptor.OfField](#) |\n\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known Direct Subclasses [Class](../Class.html#) |-------------------------|----------------------------------------------------------------------------------------| | [Class](../Class.html#) | Instances of the class represent classes and interfaces in a running Java application. | |\n\nAn entity that has a field type descriptor. Field descriptors conforming to JVMS {@jvms 4.3.2} can be described\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract F | [arrayType](#arrayType())`()` Return a descriptor for the array type whose component type is described by this descriptor |\n| abstract F | [componentType](#componentType())`()` If this field descriptor describes an array type, return a descriptor for its component type, otherwise return `null`. |\n| abstract [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [isArray](#isArray())`()` Does this field descriptor describe an array type? |\n| abstract [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [isPrimitive](#isPrimitive())`()` Does this field descriptor describe a primitive type (including void.) |\n\n| Inherited functions ||\n|---|---|\n| From class [TypeDescriptor](/reference/kotlin/java/lang/invoke/TypeDescriptor) |-----------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | [descriptorString](/reference/kotlin/java/lang/invoke/TypeDescriptor#descriptorString())`()` Returns the descriptor string for this `TypeDescriptor` object. If this `TypeDescriptor` object can be described in nominal form, then this method returns a type descriptor as specified in JVMS {@jvms 4.3}. The result descriptor string can be used to produce a `java.lang.constant.ConstantDesc nominal descriptor`. Otherwise, the result string is not a type descriptor. No `java.lang.constant.ConstantDesc nominal descriptor` can be produced from the result string. \u003cbr /\u003e | ||\n\nPublic methods\n--------------\n\n### arrayType\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun arrayType(): F\n```\n\nReturn a descriptor for the array type whose component type is described by this descriptor\n\n| Return ||\n|---|-----------------------------------|\n| F | the descriptor for the array type |\n\n### componentType\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun componentType(): F\n```\n\nIf this field descriptor describes an array type, return a descriptor for its component type, otherwise return `null`.\n\n| Return ||\n|---|----------------------------------------------------------------------------------------|\n| F | the component type, or `null` if this field descriptor does not describe an array type |\n\n### isArray\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun isArray(): Boolean\n```\n\nDoes this field descriptor describe an array type?\n\n| Return ||\n|------------------------------------------------------------------------------------|-------------------------------------------------------|\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | whether this field descriptor describes an array type |\n\n### isPrimitive\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun isPrimitive(): Boolean\n```\n\nDoes this field descriptor describe a primitive type (including void.)\n\n| Return ||\n|------------------------------------------------------------------------------------|----------------------------------------------------------|\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | whether this field descriptor describes a primitive type |"]]