F
- the type representing field type descriptorsM
- the class implementing TypeDescriptor.OfMethod
TypeDescriptor
MethodTypeDesc
MethodType
TypeDescriptor
public static interface TypeDescriptor.OfMethod<F extends TypeDescriptor.OfField<F>,M extends TypeDescriptor.OfMethod<F,M>> extends TypeDescriptor
MethodType::describeConstable
; otherwise they cannot be described nominally.TypeDescriptor.OfField<F extends TypeDescriptor.OfField<F>>, TypeDescriptor.OfMethod<F extends TypeDescriptor.OfField<F>,M extends TypeDescriptor.OfMethod<F,M>>
Modifier and Type | Method | Description |
---|---|---|
M |
changeParameterType |
Return a method descriptor that is identical to this one, except that a single parameter type has been changed to the specified type. |
M |
changeReturnType |
Return a method descriptor that is identical to this one, except that the return type has been changed to the specified type |
M |
dropParameterTypes |
Return a method descriptor that is identical to this one, except that a range of parameter types have been removed. |
M |
insertParameterTypes |
Return a method descriptor that is identical to this one, except that a range of additional parameter types have been inserted. |
F[] |
parameterArray() |
Return an array of field descriptors for the parameter types of the method type described by this descriptor |
int |
parameterCount() |
Return the number of parameters in the method type |
List |
parameterList() |
Return an immutable list of field descriptors for the parameter types of the method type described by this descriptor |
F |
parameterType |
Return a field descriptor describing the requested parameter of the method type described by this descriptor |
F |
returnType() |
Return a field descriptor describing the return type of the method type described by this descriptor |
descriptorString
int parameterCount()
F parameterType(int i)
i
- the index of the parameterIndexOutOfBoundsException
- if the index is outside the half-open range {[0, parameterCount)}F returnType()
F[] parameterArray()
List<F> parameterList()
M changeReturnType(F newReturn)
newReturn
- a field descriptor for the new return typeNullPointerException
- if any argument is null
M changeParameterType(int index, F paramType)
index
- the index of the parameter to changeparamType
- a field descriptor describing the new parameter typeNullPointerException
- if any argument is null
IndexOutOfBoundsException
- if the index is outside the half-open range {[0, parameterCount)}M dropParameterTypes(int start, int end)
start
- the index of the first parameter to removeend
- the index after the last parameter to removeIndexOutOfBoundsException
- if start
is outside the half-open range [0, parameterCount)
, or end
is outside the closed range [0, parameterCount]
, or if start > end
M insertParameterTypes(int pos, F... paramTypes)
pos
- the index at which to insert the first inserted parameterparamTypes
- field descriptors describing the new parameter types to insertNullPointerException
- if any argument is null
IndexOutOfBoundsException
- if pos
is outside the closed range {[0, parameterCount]}
© 1993, 2023, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/invoke/TypeDescriptor.OfMethod.html