# TypeDescriptor.OfField

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# OfField

```
interface OfField<F : TypeDescriptor.OfField<F>!> : TypeDescriptor
```

|------------------------------------------------------------------------------------------------------------------------------------|
| [java.lang.invoke.TypeDescriptor.OfField](https://developer.android.com/reference/kotlin/java/lang/invoke/TypeDescriptor.OfField#) |

|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Known Direct Subclasses [Class](https://developer.android.com/reference/kotlin/java/lang/Class.html#) |-------------------------------------------------------------------------------|----------------------------------------------------------------------------------------| | [Class](https://developer.android.com/reference/kotlin/java/lang/Class.html#) | 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                                                                                                                                                                 ||
|--------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| abstractF                                                                                  | [arrayType](https://developer.android.com/reference/kotlin/java/lang/invoke/TypeDescriptor.OfField#arrayType())`()` Return a descriptor for the array type whose component type is described by this descriptor                                   |
| abstractF                                                                                  | [componentType](https://developer.android.com/reference/kotlin/java/lang/invoke/TypeDescriptor.OfField#componentType())`()` If this field descriptor describes an array type, return a descriptor for its component type, otherwise return`null`. |
| abstract[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [isArray](https://developer.android.com/reference/kotlin/java/lang/invoke/TypeDescriptor.OfField#isArray())`()` Does this field descriptor describe an array type?                                                                                |
| abstract[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [isPrimitive](https://developer.android.com/reference/kotlin/java/lang/invoke/TypeDescriptor.OfField#isPrimitive())`()` Does this field descriptor describe a primitive type (including void.)                                                    |

| Inherited functions ||
|---|---|
| From class[TypeDescriptor](https://developer.android.com/reference/kotlin/java/lang/invoke/TypeDescriptor) |-----------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | [descriptorString](https://developer.android.com/reference/kotlin/java/lang/invoke/TypeDescriptor#descriptorString())`()` <br /> 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. <br /> | ||

## Public methods

### arrayType

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
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

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
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

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
abstract fun isArray(): Boolean
```

Does this field descriptor describe an array type?

|                                                                  Return                                                                   ||
|------------------------------------------------------------------------------------|-------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | whether this field descriptor describes an array type |

### isPrimitive

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
abstract fun isPrimitive(): Boolean
```

Does this field descriptor describe a primitive type (including void.)

|                                                                    Return                                                                    ||
|------------------------------------------------------------------------------------|----------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | whether this field descriptor describes a primitive type |