Package edu.wpi.first.util.struct
Class StructGenerator.SchemaBuilder.EnumFieldBuilder
java.lang.Object
edu.wpi.first.util.struct.StructGenerator.SchemaBuilder.EnumFieldBuilder
- Enclosing class:
- StructGenerator.SchemaBuilder
A utility for building enum fields in a procedural manner.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddVariant
(String name, int value) Adds a variant to the enum field.build()
Builds the enum field.
-
Constructor Details
-
EnumFieldBuilder
Creates a new enum field builder.- Parameters:
fieldName
- The name of the field.
-
-
Method Details
-
addVariant
Adds a variant to the enum field.- Parameters:
name
- The name of the variant.value
- The value of the variant.- Returns:
- The builder for chaining.
-
build
Builds the enum field. If this object is being used withStructGenerator.SchemaBuilder.addEnumField(edu.wpi.first.util.struct.StructGenerator.SchemaBuilder.EnumFieldBuilder)
thenbuild()
does not have to be called by the user.- Returns:
- The built enum field.
-