Interface MethodBuilder

All Superinterfaces:
ClassFileBuilder<MethodElement, MethodBuilder>, Consumer<MethodElement>

public sealed interface MethodBuilder extends ClassFileBuilder<MethodElement, MethodBuilder>
A builder for methods. The main way to obtain a method builder is via ClassBuilder.withMethod(String, MethodTypeDesc, int, Consumer). ClassBuilder.withMethodBody(String, MethodTypeDesc, int, Consumer) is useful if no attribute on the method except Code needs to be configured, skipping the method handler.

Refer to ClassFileBuilder for general guidance and caution around the use of builders for structures in the class file format.

See Java Virtual Machine Specification:
4.6 Methods
Since:
24
See Also: