Module java.base
Package java.lang.classfile

# Interface MethodModel

≠
public abstract sealed interface MethodModel
extends java.lang.classfile.AttributedElement, java.lang.classfile.ClassElement, java.lang.classfile.CompoundElement<java.lang.classfile.MethodElement>
permits jdk.internal.classfile.impl.MethodImpl, jdk.internal.classfile.impl.BufferedMethodBuilder.Model
Comparing jdk-master and valhalla-csr-open

All Superinterfaces:
  `AttributedElement, ClassElementPREVIEW , ClassFileElement, CompoundElement<MethodElement>, Iterable<MethodElement>`

public sealed interface MethodModel extends CompoundElement<MethodElement>, AttributedElement, ClassElementPREVIEW
Models a method. A method can be viewed as a composition of `MethodElement` s, or by random access via accessor methods if only specific parts of the method is needed.

Methods can be obtained from `ClassModel.methods()` , or in the traversal of member elements of a class.

`ClassBuilder.withMethod(String, MethodTypeDesc, int, Consumer)` is the main way to construct methods. `ClassBuilder.transformMethod(MethodModel, MethodTransform)` allows creating a new method by selectively processing the original method elements and directing the results to a method builder.

All method attributes are accessible as member elements.

See Java Virtual Machine Specification:
  4.6 Methods
Since:
  24
See Also:
  - `ClassModel.methods()`
  - `MethodTransform`

## Methods

- =
  public abstract java.util.Optional<java.lang.classfile.CodeModel> code()
- =
  public abstract java.lang.classfile.AccessFlags flags()
- =
  public abstract java.lang.classfile.constantpool.Utf8Entry methodName()
- =
  public abstract java.lang.classfile.constantpool.Utf8Entry methodType()
- =
  public default java.lang.constant.MethodTypeDesc methodTypeSymbol()
- =
  public abstract java.util.Optional<java.lang.classfile.ClassModel> parent()

## Summary

Differences
| Elements | Comments | Descriptions | Total
Added | Changed | Removed | Added | Changed | Removed | Added | Changed | Removed
--- | --- | --- | --- | --- | --- | --- | --- | ---
MethodModel |  |  |  |  |  |  | 2 |  |  | 2
Total |  |  |  |  |  |  | 2 |  |  | 2