Module java.base
Package java.lang.classfile

# Interface FieldBuilder

≠
public abstract sealed interface FieldBuilder
extends java.lang.classfile.ClassFileBuilder<java.lang.classfile.FieldElement, java.lang.classfile.FieldBuilder>
permits jdk.internal.classfile.impl.ChainedFieldBuilder, jdk.internal.classfile.impl.TerminalFieldBuilder
Comparing master and cf

All Superinterfaces:
  `ClassFileBuilder<FieldElement, FieldBuilder>, Consumer<FieldElement>`

public sealed interface FieldBuilder extends ClassFileBuilder<FieldElement, FieldBuilder>
A builder for fields. Builders are not created directly; they are passed to handlers by methods such as The main way to obtain a field builder is via `Moved out of a link with destination ClassBuilder.html#withField(java.lang.classfile.constantpool.Utf8Entry,java.lang.classfile.constantpool.Utf8Entry,java.util.function.Consumer).Moved to a link with destination ClassBuilder.html#withField(java.lang.String,java.lang.constant.ClassDesc,java.util.function.Consumer).ClassBuilder.withField(` Utf8Entry `StringMoved out of a link with destination ClassBuilder.html#withField(java.lang.classfile.constantpool.Utf8Entry,java.lang.classfile.constantpool.Utf8Entry,java.util.function.Consumer).Moved to a link with destination ClassBuilder.html#withField(java.lang.String,java.lang.constant.ClassDesc,java.util.function.Consumer).,` Utf8Entry `ClassDescMoved out of a link with destination ClassBuilder.html#withField(java.lang.classfile.constantpool.Utf8Entry,java.lang.classfile.constantpool.Utf8Entry,java.util.function.Consumer).Moved to a link with destination ClassBuilder.html#withField(java.lang.String,java.lang.constant.ClassDesc,java.util.function.Consumer)., Consumer)` or to field transforms. The elements of a field can be specified abstractly (by passing a `FieldElement` to `ClassFileBuilder.with(ClassFileElement)` or concretely by calling the various `withXxx` methods. The access flag overload is useful if no attribute needs to be configured, skipping the handler.

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

Since:
  24
See Also:
  Moved out of an unordered list with class tag-list.Moved to an unordered list with class tag-list-long.
  - `ClassBuilder.withField(String, ClassDesc, Consumer)`
  - `FieldModel`
  - `Moved out of an unordered list with class tag-list.Moved to an unordered list with class tag-list-long.FieldTransform` Moved out of an unordered list with class tag-list.Moved to an unordered list with class tag-list-long.
Moved out of an unordered list with class tag-list.Moved to an unordered list with class tag-list-long.

Moved out of an unordered list with class tag-list.Moved to an unordered list with class tag-list-long.
Moved out of an unordered list with class tag-list.Moved to an unordered list with class tag-list-long.

## Methods

- ≠
  public default java.lang.classfile.FieldBuilder withFlags(int arg0)
  Comparing master and cf

  ### withFlags

  default FieldBuilder withFlags (int flags)
  Sets the field access flags.
  Parameters:
    `flags` - the access flags, as a bit mask
  Returns:
    this builder
  See Also:
    Moved to a definition list with class notes.Moved to a definition.Moved to an unordered list with class tag-list-long.
    - `AccessFlags`
    - `AccessFlag.Location.FIELD`
    - `ClassBuilder.withField(String, ClassDesc, int)`
- =
  public default java.lang.classfile.FieldBuilder withFlags(java.lang.reflect.AccessFlag[] arg0)

## Summary

Differences
| Elements | Comments | Descriptions | Total
Added | Changed | Removed | Added | Changed | Removed | Added | Changed | Removed
--- | --- | --- | --- | --- | --- | --- | --- | ---
FieldBuilder |  |  |  |  |  |  | 2 | 8 | 5 | 15
withFlags(int) |  |  |  |  |  |  | 5 |  |  | 5
Total |  |  |  |  |  |  | 7 | 8 | 5 | 20