Module java.base
Package java.lang.classfile

# Interface FieldModel

≠
public abstract sealed interface FieldModel
extends java.lang.classfile.AttributedElement, java.lang.classfile.ClassElement, java.lang.classfile.CompoundElement<java.lang.classfile.FieldElement>
permits jdk.internal.classfile.impl.FieldImpl, jdk.internal.classfile.impl.BufferedFieldBuilder.Model
Comparing jdk-master and valhalla-csr-open

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

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

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

`ClassBuilder.withField(String, ClassDesc, Consumer)` is the main way to construct fields. `ClassBuilder.transformField(FieldModel, FieldTransform)` allows creating a new field by selectively processing the original field elements and directing the results to a field builder.

All field attributes are accessible as member elements.

See Java Virtual Machine Specification:
  4.5 Fields
Since:
  24
See Also:
  - `ClassModel.fields()`
  - `FieldTransform`

## Methods

- =
  public abstract java.lang.classfile.constantpool.Utf8Entry fieldName()
- =
  public abstract java.lang.classfile.constantpool.Utf8Entry fieldType()
- =
  public default java.lang.constant.ClassDesc fieldTypeSymbol()
- =
  public abstract java.lang.classfile.AccessFlags flags()
- =
  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
--- | --- | --- | --- | --- | --- | --- | --- | ---
FieldModel |  |  |  |  |  |  | 2 |  |  | 2
Total |  |  |  |  |  |  | 2 |  |  | 2