Stay organized with collections
    
    
      
      Save and categorize content based on your preferences.
    
  
  
    
  
  
  
  
    
    
    
  
  
    
    
  
  
TypeDescriptor.OfMethod
  public
  static
  
  
  interface
  TypeDescriptor.OfMethod
  
  
      implements
      
        TypeDescriptor
      
  
  
  
  
    
      | 
          Known indirect subclasses
          
  
  
    
  
  
    
      
        | 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 | 
      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.
        
    
 | 
  
  
  
  
    | 
        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
        
    
 | 
  
  
  
  
    | 
        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.
        
    
 | 
  
  
  
  
    | 
        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.
        
    
 | 
  
  
  
  
    | 
        abstract
        
        
        
        
        F[] | 
      parameterArray()
      Return an array of field descriptors for the parameter types of the method type
 described by this descriptor
        
    
 | 
  
  
  
  
    | 
        abstract
        
        
        
        
        int | 
      parameterCount()
      Return the number of parameters in the method type
        
    
 | 
  
  
  
  
    | 
        abstract
        
        
        
        
        List<F> | 
      parameterList()
      Return an immutable list of field descriptors for the parameter types of the method type
 described by this descriptor
        
    
 | 
  
  
  
  
    | 
        abstract
        
        
        
        
        F | 
      parameterType(int i)
      Return a field descriptor describing the requested parameter of the method type
 described by this descriptor
        
    
 | 
  
  
  
  
    | 
        abstract
        
        
        
        
        F | 
      returnType()
      Return a field descriptor describing the return type of the method type described
 by this descriptor
        
    
 | 
  
Public methods
    changeParameterType
    
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.
    
    | Parameters | 
|---|
      
        | index | int: the index of the parameter to change | 
      
        | paramType | F: a field descriptor describing the new parameter type | 
    
    
      | Returns | 
|---|
      
        | M | the new method descriptor | 
    
      
  
 
    changeReturnType
    
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
    
    | Parameters | 
|---|
      
        | newReturn | F: a field descriptor for the new return type | 
    
    
      | Returns | 
|---|
      
        | M | the new method descriptor | 
    
      
  
 
    dropParameterTypes
    
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.
    
    | Parameters | 
|---|
      
        | start | int: the index of the first parameter to remove | 
      
        | end | int: the index after the last parameter to remove | 
    
    
      | Returns | 
|---|
      
        | M | the new method descriptor | 
    
      
      | Throws | 
|---|
        
          | IndexOutOfBoundsException | if startis outside the half-open
 range[0, parameterCount), orendis outside the closed range[0, parameterCount], or ifstart > end | 
      
  
 
    insertParameterTypes
    
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.
    
    | Parameters | 
|---|
      
        | pos | int: the index at which to insert the first inserted parameter | 
      
        | paramTypes | F: field descriptors describing the new parameter types
                   to insert | 
    
    
      | Returns | 
|---|
      
        | M | the new method descriptor | 
    
      
  
 
    parameterArray
    
public abstract F[] parameterArray ()
    
    
    
  Return an array of field descriptors for the parameter types of the method type
 described by this descriptor
    
      | Returns | 
|---|
      
        | F[] | field descriptors for the parameter types | 
    
 
    parameterCount
    
public abstract int parameterCount ()
    
    
    
  Return the number of parameters in the method type
    
      | Returns | 
|---|
      
        | int | the number of parameters | 
    
 
    parameterList
    
public abstract List<F> parameterList ()
    
    
    
  Return an immutable list of field descriptors for the parameter types of the method type
 described by this descriptor
    
      | Returns | 
|---|
      
        | List<F> | field descriptors for the parameter types | 
    
 
    parameterType
    
public abstract F parameterType (int i)
    
    
    
  Return a field descriptor describing the requested parameter of the method type
 described by this descriptor
    
    | Parameters | 
|---|
      
        | i | int: the index of the parameter | 
    
    
      | Returns | 
|---|
      
        | F | a field descriptor for the requested parameter type | 
    
      
  
 
    returnType
    
public abstract F returnType ()
    
    
    
  Return a field descriptor describing the return type of the method type described
 by this descriptor
    
      | Returns | 
|---|
      
        | F | a field descriptor for the return 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."],[],[]]