Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Methods](https://developer.android.com/reference/java/lang/invoke/TypeDescriptor.OfMethod#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/java/lang/invoke/TypeDescriptor.OfMethod#inhmethods)

# TypeDescriptor.OfMethod

` public static interface TypeDescriptor.OfMethod `   
` implements https://developer.android.com/reference/java/lang/invoke/TypeDescriptor `

|---|
| java.lang.invoke.TypeDescriptor.OfMethod\<F extends [java.lang.invoke.TypeDescriptor.OfField](https://developer.android.com/reference/java/lang/invoke/TypeDescriptor.OfField)\<F\>, M extends [java.lang.invoke.TypeDescriptor.OfMethod](https://developer.android.com/reference/java/lang/invoke/TypeDescriptor.OfMethod)\<F, M\>\> |

Known indirect subclasses [MethodType](https://developer.android.com/reference/java/lang/invoke/MethodType) [MethodType](https://developer.android.com/reference/java/lang/invoke/MethodType) A method type represents the arguments and return type accepted and returned by a method handle, or the arguments and return type passed and expected by a method handle caller.   

*** ** * ** ***

An entity that has a method type descriptor Method descriptors conforming to JVMS {@jvms 4.3.3} can be described

## Summary

| ### Public methods ||
|---|---|
| ` abstract M` | ` https://developer.android.com/reference/java/lang/invoke/TypeDescriptor.OfMethod#changeParameterType(int,%20F)(int index, F paramType) ` Return a method descriptor that is identical to this one, except that a single parameter type has been changed to the specified type. |
| ` abstract M` | ` https://developer.android.com/reference/java/lang/invoke/TypeDescriptor.OfMethod#changeReturnType(F)(F newReturn) ` Return a method descriptor that is identical to this one, except that the return type has been changed to the specified type |
| ` abstract M` | ` https://developer.android.com/reference/java/lang/invoke/TypeDescriptor.OfMethod#dropParameterTypes(int,%20int)(int start, int end) ` Return a method descriptor that is identical to this one, except that a range of parameter types have been removed. |
| ` abstract M` | ` https://developer.android.com/reference/java/lang/invoke/TypeDescriptor.OfMethod#insertParameterTypes(int,%20F[])(int pos, F... paramTypes) ` Return a method descriptor that is identical to this one, except that a range of additional parameter types have been inserted. |
| ` abstract F[]` | ` https://developer.android.com/reference/java/lang/invoke/TypeDescriptor.OfMethod#parameterArray()() ` Return an array of field descriptors for the parameter types of the method type described by this descriptor |
| ` abstract int` | ` https://developer.android.com/reference/java/lang/invoke/TypeDescriptor.OfMethod#parameterCount()() ` Return the number of parameters in the method type |
| ` abstract https://developer.android.com/reference/java/util/List<F>` | ` https://developer.android.com/reference/java/lang/invoke/TypeDescriptor.OfMethod#parameterList()() ` Return an immutable list of field descriptors for the parameter types of the method type described by this descriptor |
| ` abstract F` | ` https://developer.android.com/reference/java/lang/invoke/TypeDescriptor.OfMethod#parameterType(int)(int i) ` Return a field descriptor describing the requested parameter of the method type described by this descriptor |
| ` abstract F` | ` https://developer.android.com/reference/java/lang/invoke/TypeDescriptor.OfMethod#returnType()() ` Return a field descriptor describing the return type of the method type described by this descriptor |

### Inherited methods

From interface ` https://developer.android.com/reference/java/lang/invoke/TypeDescriptor ` ` abstract https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/invoke/TypeDescriptor#descriptorString()() `

Returns the descriptor string for this `TypeDescriptor` object.

## Public methods

### changeParameterType

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

```
public abstract M changeParameterType (int index, 
                F paramType)
```

Return a method descriptor that is identical to this one, except that a single parameter type has been changed to the specified type.

<br />

| Parameters ||
|---|---|
| `index` | `int`: the index of the parameter to change <br /> |
| `paramType` | `F`: a field descriptor describing the new parameter type <br /> |

| Returns ||
|---|---|
| `M` | the new method descriptor <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IndexOutOfBoundsException` | if the index is outside the half-open range {\[0, parameterCount)} |
| `https://developer.android.com/reference/java/lang/NullPointerException` | if any argument is `null` |

### changeReturnType

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

```
public abstract M changeReturnType (F newReturn)
```

Return a method descriptor that is identical to this one, except that the return type has been changed to the specified type

<br />

| Parameters ||
|---|---|
| `newReturn` | `F`: a field descriptor for the new return type <br /> |

| Returns ||
|---|---|
| `M` | the new method descriptor <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/NullPointerException` | if any argument is `null` |

### dropParameterTypes

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

```
public abstract M dropParameterTypes (int start, 
                int end)
```

Return a method descriptor that is identical to this one, except that a range of parameter types have been removed.

<br />

| Parameters ||
|---|---|
| `start` | `int`: the index of the first parameter to remove <br /> |
| `end` | `int`: the index after the last parameter to remove <br /> |

| Returns ||
|---|---|
| `M` | the new method descriptor <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IndexOutOfBoundsException` | if `start` is outside the half-open range `[0, parameterCount)`, or `end` is outside the closed range `[0, parameterCount]`, or if `start > end` |

### insertParameterTypes

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

```
public abstract M insertParameterTypes (int pos, 
                F... paramTypes)
```

Return a method descriptor that is identical to this one, except that a range of additional parameter types have been inserted.

<br />

| Parameters ||
|---|---|
| `pos` | `int`: the index at which to insert the first inserted parameter <br /> |
| `paramTypes` | `F`: field descriptors describing the new parameter types to insert <br /> |

| Returns ||
|---|---|
| `M` | the new method descriptor <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IndexOutOfBoundsException` | if `pos` is outside the closed range {\[0, parameterCount\]} |
| `https://developer.android.com/reference/java/lang/NullPointerException` | if any argument is `null` |

### parameterArray

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

```
public abstract F[] parameterArray ()
```

Return an array of field descriptors for the parameter types of the method type described by this descriptor

<br />

| Returns ||
|---|---|
| `F[]` | field descriptors for the parameter types <br /> |

### parameterCount

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

```
public abstract int parameterCount ()
```

Return the number of parameters in the method type

<br />

| Returns ||
|---|---|
| `int` | the number of parameters <br /> |

### parameterList

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

```
public abstract List<F> parameterList ()
```

Return an immutable list of field descriptors for the parameter types of the method type described by this descriptor

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/List<F>` | field descriptors for the parameter types <br /> |

### parameterType

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

```
public abstract F parameterType (int i)
```

Return a field descriptor describing the requested parameter of the method type described by this descriptor

<br />

| Parameters ||
|---|---|
| `i` | `int`: the index of the parameter <br /> |

| Returns ||
|---|---|
| `F` | a field descriptor for the requested parameter type <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IndexOutOfBoundsException` | if the index is outside the half-open range {\[0, parameterCount)} |

### returnType

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

```
public abstract F returnType ()
```

Return a field descriptor describing the return type of the method type described by this descriptor

<br />

| Returns ||
|---|---|
| `F` | a field descriptor for the return type <br /> |