Package edu.wpi.first.util.struct
Class StructGenerator.SchemaBuilder
java.lang.Object
edu.wpi.first.util.struct.StructGenerator.SchemaBuilder
- Enclosing class:
- StructGenerator
A utility for building schema syntax in a procedural manner.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
A utility for building enum fields in a procedural manner. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddEnumField
(StructGenerator.SchemaBuilder.EnumFieldBuilder enumFieldBuilder) Adds an inline enum field to the schema.Adds a field to the schema.build()
Builds the schema.
-
Constructor Details
-
SchemaBuilder
public SchemaBuilder()Creates a new schema builder.
-
-
Method Details
-
addField
Adds a field to the schema.- Parameters:
name
- The name of the field.type
- The type of the field.- Returns:
- The builder for chaining.
-
addEnumField
public StructGenerator.SchemaBuilder addEnumField(StructGenerator.SchemaBuilder.EnumFieldBuilder enumFieldBuilder) Adds an inline enum field to the schema.- Parameters:
enumFieldBuilder
- The builder for the enum field.- Returns:
- The builder for chaining.
-
build
Builds the schema.- Returns:
- The built schema.
-