Interface FieldBuilder
- All Superinterfaces:
ClassFileBuilderPREVIEW<FieldElementPREVIEW,,FieldBuilderPREVIEW> Consumer<FieldElementPREVIEW>
public sealed interface FieldBuilder
extends ClassFileBuilderPREVIEW<FieldElementPREVIEW,FieldBuilderPREVIEW>
FieldBuilder is a preview API of the Java platform.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
A builder for fields. Builders are not created directly; they are passed
to handlers by methods such as
ClassBuilder.withField(Utf8Entry, Utf8Entry, Consumer)PREVIEW
or to field transforms. The elements of a field can be specified
abstractly (by passing a FieldElementPREVIEW to ClassFileBuilder.with(ClassFileElement)PREVIEW
or concretely by calling the various withXxx methods.- Since:
- 22
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault FieldBuilderPREVIEWwithFlags(int flags) Sets the field access flags.default FieldBuilderPREVIEWwithFlags(AccessFlag... flags) Sets the field access flags.Methods declared in interface java.lang.classfile.ClassFileBuilderPREVIEW
accept, constantPool, transform, with
-
Method Details
-
withFlags
Sets the field access flags.- Parameters:
flags- the access flags, as a bit mask- Returns:
- this builder
-
withFlags
Sets the field access flags.- Parameters:
flags- the access flags, as a bit mask- Returns:
- this builder
-
FieldBuilderwhen preview features are enabled.