# Uses of Interface
java.lang.constant.MethodTypeDesc

Packages that use MethodTypeDesc
Package
Description
java.lang.classfile
Provides classfile parsing, generation, and transformation library.
java.lang.classfile.attribute
Provides interfaces describing `class` file attributes for the `java.lang.classfile` library.
java.lang.classfile.constantpool
Provides interfaces describing constant pool entries for the `java.lang.classfile` library.
java.lang.classfile.instruction
Provides interfaces describing code instructions for the `java.lang.classfile` library.
java.lang.constant
Classes and interfaces to represent nominal descriptors for run-time entities such as classes or method handles, and classfile entities such as constant pool entries or `invokedynamic` call sites.
java.lang.invoke
The `java.lang.invoke` package provides low-level primitives for interacting with the Java Virtual Machine.

- ## Uses of MethodTypeDesc in java.lang.classfile

  Methods in java.lang.classfile that return MethodTypeDesc
  Modifier and Type
  Method
  Description
  `default MethodTypeDesc`
  MethodModel.`methodTypeSymbol()`
  Returns the method type, as a symbolic descriptor.
  Methods in java.lang.classfile with parameters of type MethodTypeDesc
  Modifier and Type
  Method
  Description
  `default CodeBuilder`
  CodeBuilder.`invoke(Opcode opcode, ClassDesc owner, String name, MethodTypeDesc desc, boolean isInterface)`
  Generates an instruction to invoke a method.
  `default CodeBuilder`
  CodeBuilder.`invokeinterface(ClassDesc owner, String name, MethodTypeDesc type)`
  Generates an instruction to invoke an interface method.
  `default CodeBuilder`
  CodeBuilder.`invokespecial(ClassDesc owner, String name, MethodTypeDesc type)`
  Generates an instruction to invoke an instance method in a class; direct invocation of instance initialization methods and methods of the current class and its supertypes.
  `default CodeBuilder`
  CodeBuilder.`invokespecial(ClassDesc owner, String name, MethodTypeDesc type, boolean isInterface)`
  Generates an instruction to invoke an instance method; direct invocation of instance initialization methods and methods of the current class and its supertypes.
  `default CodeBuilder`
  CodeBuilder.`invokestatic(ClassDesc owner, String name, MethodTypeDesc type)`
  Generates an instruction to invoke a class (static) method of a class.
  `default CodeBuilder`
  CodeBuilder.`invokestatic(ClassDesc owner, String name, MethodTypeDesc type, boolean isInterface)`
  Generates an instruction to invoke a class (static) method.
  `default CodeBuilder`
  CodeBuilder.`invokevirtual(ClassDesc owner, String name, MethodTypeDesc type)`
  Generates an instruction to invoke an instance method; dispatch based on class.
  `static MethodSignature`
  MethodSignature.`of(MethodTypeDesc methodDescriptor)`
  Returns a method signature for a raw method descriptor.
  `default ClassBuilder`
  ClassBuilder.`withMethod(String name, MethodTypeDesc descriptor, int methodFlags, Consumer<? super MethodBuilder> handler)`
  Adds a method.
  `default ClassBuilder`
  ClassBuilder.`withMethodBody(String name, MethodTypeDesc descriptor, int methodFlags, Consumer<? super CodeBuilder> handler)`
  Adds a method, with only access flags and a `CodeModel`.

- ## Uses of MethodTypeDesc in java.lang.classfile.attribute

  Methods in java.lang.classfile.attribute that return types with arguments of type MethodTypeDesc
  Modifier and Type
  Method
  Description
  `default Optional<MethodTypeDesc>`
  EnclosingMethodAttribute.`enclosingMethodTypeSymbol()`
  Returns the name of the enclosing method, if the class is immediately enclosed by exactly one method or constructor.

- ## Uses of MethodTypeDesc in java.lang.classfile.constantpool

  Methods in java.lang.classfile.constantpool that return MethodTypeDesc
  Modifier and Type
  Method
  Description
  `MethodTypeDesc`
  MethodTypeEntry.`asSymbol()`
  Returns a symbolic descriptor for the method type.
  `default MethodTypeDesc`
  InterfaceMethodRefEntry.`typeSymbol()`
  Returns a symbolic descriptor for the method type.
  `default MethodTypeDesc`
  InvokeDynamicEntry.`typeSymbol()`
  Returns a symbolic descriptor for the invocation type of this dynamic call site.
  `default MethodTypeDesc`
  MethodRefEntry.`typeSymbol()`
  Returns a symbolic descriptor for the method type.
  Methods in java.lang.classfile.constantpool with parameters of type MethodTypeDesc
  Modifier and Type
  Method
  Description
  `default InterfaceMethodRefEntry`
  ConstantPoolBuilder.`interfaceMethodRefEntry(ClassDesc owner, String name, MethodTypeDesc type)`
  Returns an `InterfaceMethodRefEntry` describing a method of an interface.
  `default MethodRefEntry`
  ConstantPoolBuilder.`methodRefEntry(ClassDesc owner, String name, MethodTypeDesc type)`
  Returns a `MethodRefEntry` describing a method of a class.
  `MethodTypeEntry`
  ConstantPoolBuilder.`methodTypeEntry(MethodTypeDesc descriptor)`
  Returns a `MethodTypeEntry` describing the same method type as the provided `MethodTypeDesc`.
  `default NameAndTypeEntry`
  ConstantPoolBuilder.`nameAndTypeEntry(String name, MethodTypeDesc type)`
  Returns a `NameAndTypeEntry` describing the provided name and method descriptor.
  `default Utf8Entry`
  ConstantPoolBuilder.`utf8Entry(MethodTypeDesc desc)`
  Returns a `Utf8Entry` describing the method descriptor string of the provided `MethodTypeDesc`.

- ## Uses of MethodTypeDesc in java.lang.classfile.instruction

  Methods in java.lang.classfile.instruction that return MethodTypeDesc
  Modifier and Type
  Method
  Description
  `default MethodTypeDesc`
  InvokeDynamicInstruction.`typeSymbol()`
  Returns the invocation type of the call site, as a symbolic descriptor.
  `default MethodTypeDesc`
  InvokeInstruction.`typeSymbol()`
  Returns a symbolic descriptor for the method type.

- ## Uses of MethodTypeDesc in java.lang.constant

  Subinterfaces with type arguments of type MethodTypeDesc in java.lang.constant
  Modifier and Type
  Interface
  Description
  `interface`
  `MethodTypeDesc`
  A nominal descriptor for a MethodType constant.
  Fields in java.lang.constant declared as MethodTypeDesc
  Modifier and Type
  Field
  Description
  `static final MethodTypeDesc`
  ConstantDescs.`MTD_void`
  Nominal descriptor representing the method descriptor `()V`, taking no argument and returning `void`.
  Methods in java.lang.constant that return MethodTypeDesc
  Modifier and Type
  Method
  Description
  `MethodTypeDesc`
  MethodTypeDesc.`changeParameterType(int index, ClassDesc paramType)`
  Returns a MethodTypeDesc that is identical to this one, except that a single parameter type has been changed to the specified type.
  `MethodTypeDesc`
  MethodTypeDesc.`changeReturnType(ClassDesc returnType)`
  Returns a MethodTypeDesc that is identical to this one, except with the specified return type.
  `MethodTypeDesc`
  MethodTypeDesc.`dropParameterTypes(int start, int end)`
  Returns a MethodTypeDesc that is identical to this one, except that a range of parameter types have been removed.
  `MethodTypeDesc`
  MethodTypeDesc.`insertParameterTypes(int pos, ClassDesc... paramTypes)`
  Returns a MethodTypeDesc that is identical to this one, except that a range of additional parameter types have been inserted.
  `MethodTypeDesc`
  DynamicCallSiteDesc.`invocationType()`
  Returns a `MethodTypeDesc` describing the invocation type that would appear in the `NameAndType` operand of the `invokedynamic`.
  `MethodTypeDesc`
  MethodHandleDesc.`invocationType()`
  Returns a `MethodTypeDesc` describing the invocation type of the method handle described by this nominal descriptor.
  `static MethodTypeDesc`
  MethodTypeDesc.`of(ClassDesc returnDesc)`
  Returns a MethodTypeDesc with the given return type and no parameter types.
  `static MethodTypeDesc`
  MethodTypeDesc.`of(ClassDesc returnDesc, ClassDesc... paramDescs)`
  Returns a MethodTypeDesc given the return type and parameter types.
  `static MethodTypeDesc`
  MethodTypeDesc.`of(ClassDesc returnDesc, List<ClassDesc> paramDescs)`
  Returns a MethodTypeDesc given the return type and a list of parameter types.
  `static MethodTypeDesc`
  MethodTypeDesc.`ofDescriptor(String descriptor)`
  Creates a MethodTypeDesc given a method descriptor string.
  Methods in java.lang.constant with parameters of type MethodTypeDesc
  Modifier and Type
  Method
  Description
  `default MethodHandleDesc`
  MethodHandleDesc.`asType(MethodTypeDesc type)`
  Returns a MethodHandleDesc that describes this method handle adapted to a different type, as if by `MethodHandle.asType(MethodType)`.
  `static DynamicCallSiteDesc`
  DynamicCallSiteDesc.`of(DirectMethodHandleDesc bootstrapMethod, MethodTypeDesc invocationType)`
  Creates a nominal descriptor for an `invokedynamic` call site whose bootstrap method has no static arguments and for which the name parameter is `ConstantDescs.DEFAULT_NAME`.
  `static DynamicCallSiteDesc`
  DynamicCallSiteDesc.`of(DirectMethodHandleDesc bootstrapMethod, String invocationName, MethodTypeDesc invocationType)`
  Creates a nominal descriptor for an `invokedynamic` call site whose bootstrap method has no static arguments.
  `static DynamicCallSiteDesc`
  DynamicCallSiteDesc.`of(DirectMethodHandleDesc bootstrapMethod, String invocationName, MethodTypeDesc invocationType, ConstantDesc... bootstrapArgs)`
  Creates a nominal descriptor for an `invokedynamic` call site.
  `static DirectMethodHandleDesc`
  MethodHandleDesc.`ofMethod(DirectMethodHandleDesc.Kind kind, ClassDesc owner, String name, MethodTypeDesc lookupMethodType)`
  Creates a MethodHandleDesc corresponding to an invocation of a declared method or constructor.
  `DynamicCallSiteDesc`
  DynamicCallSiteDesc.`withNameAndType(String invocationName, MethodTypeDesc invocationType)`
  Returns a nominal descriptor for an `invokedynamic` call site whose bootstrap and bootstrap arguments are the same as this one, but with the specified invocationName and invocation invocationType

- ## Uses of MethodTypeDesc in java.lang.invoke

  Methods in java.lang.invoke that return types with arguments of type MethodTypeDesc
  Modifier and Type
  Method
  Description
  `Optional<MethodTypeDesc>`
  MethodType.`describeConstable()`
  Returns a nominal descriptor for this instance, if one can be constructed, or an empty `Optional` if one cannot be.