Interface TypeStructureBuilder
-
- All Superinterfaces:
AnnotatedElementBuilder<TypeStructureBuilder>
public interface TypeStructureBuilder extends AnnotatedElementBuilder<TypeStructureBuilder>
A fluent API for building composite types lazily.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TypeStructureBuilderaddField(String name, Type type)Add a field of the given name and typeTypeStructureBuilderaddField(String name, Type type, Consumer<TypedFieldBuilder> fieldCallback)Add a field of the given name and type and with a customization callbackTypeStructureBuilderaddField(String name, Types.Predefined type)Add a field of the given name and (predefined) typeTypeStructureBuilderaddField(String name, Types.Predefined type, Consumer<TypedFieldBuilder> fieldCallback)Add a field of the given name and (predefined) type and with a customization callbackTypeStructureBuilderaddField(TypedField field)Add a specific field.TypeStructureBuilderaddFields(TypedField field1, TypedField field2, TypedField... fields)Add specific fields.TypeStructurebuild()TyperegisterAs(String name, String supertype)A shortcut to build-and-register functionalityTypeselfType()A special placeholder type to refer to the type being currently built (otherwise impossible because the type is not yet ready).-
Methods inherited from interface org.openjdk.jmc.flightrecorder.writer.api.AnnotatedElementBuilder
addAnnotation, addAnnotation, addAnnotation, addAnnotation, addAnnotation, addAnnotation
-
-
-
-
Method Detail
-
addField
TypeStructureBuilder addField(String name, Types.Predefined type)
Add a field of the given name and (predefined) type- Parameters:
name- the field nametype- the field type- Returns:
- a TypeStructureBuilder instance for invocation chaining
-
addField
TypeStructureBuilder addField(String name, Types.Predefined type, Consumer<TypedFieldBuilder> fieldCallback)
Add a field of the given name and (predefined) type and with a customization callback- Parameters:
name- the field nametype- the field typefieldCallback- the field customization callback- Returns:
- a TypeStructureBuilder instance for invocation chaining
-
addField
TypeStructureBuilder addField(String name, Type type)
Add a field of the given name and type- Parameters:
name- the field nametype- the field type- Returns:
- a TypeStructureBuilder instance for invocation chaining
-
addField
TypeStructureBuilder addField(String name, Type type, Consumer<TypedFieldBuilder> fieldCallback)
Add a field of the given name and type and with a customization callback- Parameters:
name- the field nametype- the field typefieldCallback- the field customization callback- Returns:
- a TypeStructureBuilder instance for invocation chaining
-
addField
TypeStructureBuilder addField(TypedField field)
Add a specific field.- Parameters:
field- field- Returns:
- a TypeStructureBuilder instance for invocation chaining
-
addFields
TypeStructureBuilder addFields(TypedField field1, TypedField field2, TypedField... fields)
Add specific fields.- Parameters:
field1- first fieldfield2- second fieldfields- other fields (if any)- Returns:
- a TypeStructureBuilder instance for invocation chaining
-
selfType
Type selfType()
A special placeholder type to refer to the type being currently built (otherwise impossible because the type is not yet ready).- Returns:
- a special Type denoting 'self' reflecting type
-
build
TypeStructure build()
- Returns:
- built TypeStructure
-
-