Module java.base
Package java.lang.classfile

# Interface ClassBuilder

≠
public abstract sealed interface ClassBuilder
extends java.lang.classfile.ClassFileBuilder<java.lang.classfile.ClassElement, java.lang.classfile.ClassBuilder>
permits jdk.internal.classfile.impl.ChainedClassBuilder, jdk.internal.classfile.impl.DirectClassBuilder
Comparing jdk-master and valhalla-csr-open

All Superinterfaces:
  `ClassFileBuilder<ClassElementPREVIEW , ClassBuilder>, Consumer<ClassElementPREVIEW >`

public sealed interface ClassBuilder extends ClassFileBuilder<ClassElementPREVIEW , ClassBuilder>
A builder for a `class` file. `ClassFile` provides different `build` methods that accept handlers to configure such a builder; `ClassFile.build(ClassDesc, Consumer)` suffices for basic usage, while `ClassFile.build(ClassEntry, ConstantPoolBuilder, Consumer)` allows fine-grained control over the constant pool.

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

Since:
  24
See Also:
  - `ClassFile.build(ClassEntry, ConstantPoolBuilder, Consumer)`
  - `ClassModel`
  - `ClassTransform`

## Methods

- =
  public abstract java.lang.classfile.ClassBuilder transformField(java.lang.classfile.FieldModel arg0, java.lang.classfile.FieldTransform arg1)
- =
  public abstract java.lang.classfile.ClassBuilder transformMethod(java.lang.classfile.MethodModel arg0, java.lang.classfile.MethodTransform arg1)
- =
  public default java.lang.classfile.ClassBuilder withField(java.lang.String arg0, java.lang.constant.ClassDesc arg1, int arg2)
- =
  public default java.lang.classfile.ClassBuilder withField(java.lang.String arg0, java.lang.constant.ClassDesc arg1, java.util.function.Consumer<? super java.lang.classfile.FieldBuilder> arg2)
- =
  public default java.lang.classfile.ClassBuilder withField(java.lang.classfile.constantpool.Utf8Entry arg0, java.lang.classfile.constantpool.Utf8Entry arg1, int arg2)
- =
  public abstract java.lang.classfile.ClassBuilder withField(java.lang.classfile.constantpool.Utf8Entry arg0, java.lang.classfile.constantpool.Utf8Entry arg1, java.util.function.Consumer<? super java.lang.classfile.FieldBuilder> arg2)
- =
  public default java.lang.classfile.ClassBuilder withFlags(int arg0)
- =
  public default java.lang.classfile.ClassBuilder withFlags(java.lang.reflect.AccessFlag[] arg0)
- =
  public default java.lang.classfile.ClassBuilder withInterfaceSymbols(java.lang.constant.ClassDesc[] arg0)
- =
  public default java.lang.classfile.ClassBuilder withInterfaceSymbols(java.util.List<java.lang.constant.ClassDesc> arg0)
- =
  public default java.lang.classfile.ClassBuilder withInterfaces(java.lang.classfile.constantpool.ClassEntry[] arg0)
- =
  public default java.lang.classfile.ClassBuilder withInterfaces(java.util.List<java.lang.classfile.constantpool.ClassEntry> arg0)
- =
  public default java.lang.classfile.ClassBuilder withMethod(java.lang.String arg0, java.lang.constant.MethodTypeDesc arg1, int arg2, java.util.function.Consumer<? super java.lang.classfile.MethodBuilder> arg3)
- =
  public abstract java.lang.classfile.ClassBuilder withMethod(java.lang.classfile.constantpool.Utf8Entry arg0, java.lang.classfile.constantpool.Utf8Entry arg1, int arg2, java.util.function.Consumer<? super java.lang.classfile.MethodBuilder> arg3)
- =
  public default java.lang.classfile.ClassBuilder withMethodBody(java.lang.String arg0, java.lang.constant.MethodTypeDesc arg1, int arg2, java.util.function.Consumer<? super java.lang.classfile.CodeBuilder> arg3)
- =
  public default java.lang.classfile.ClassBuilder withMethodBody(java.lang.classfile.constantpool.Utf8Entry arg0, java.lang.classfile.constantpool.Utf8Entry arg1, int arg2, java.util.function.Consumer<? super java.lang.classfile.CodeBuilder> arg3)
- =
  public default java.lang.classfile.ClassBuilder withSuperclass(java.lang.classfile.constantpool.ClassEntry arg0)
- =
  public default java.lang.classfile.ClassBuilder withSuperclass(java.lang.constant.ClassDesc arg0)
- =
  public default java.lang.classfile.ClassBuilder withVersion(int arg0, int arg1)

## Summary

Differences
| Elements | Comments | Descriptions | Total
Added | Changed | Removed | Added | Changed | Removed | Added | Changed | Removed
--- | --- | --- | --- | --- | --- | --- | --- | ---
ClassBuilder |  |  |  |  |  |  | 3 |  |  | 3
Total |  |  |  |  |  |  | 3 |  |  | 3