Module dev.metaschema.core
Package dev.metaschema.core.model
Class FlagContainerBuilder<T extends IFlagInstance>
java.lang.Object
dev.metaschema.core.model.FlagContainerBuilder<T>
- Type Parameters:
T- the Java type of flag instances
- All Implemented Interfaces:
IFlagContainerBuilder<T>
public class FlagContainerBuilder<T extends IFlagInstance>
extends Object
implements IFlagContainerBuilder<T>
Default implementation of
IFlagContainerBuilder.
This builder collects flag instances and constructs an immutable flag container. It handles duplicate flags (shadowing) by logging errors and using the last instance encountered. An optional JSON key flag can be specified.
-
Constructor Summary
ConstructorsConstructorDescriptionFlagContainerBuilder(Integer jsonKeyIndex) Construct a new flag container using the provided flag qualified name as the JSON key. -
Method Summary
Modifier and TypeMethodDescriptionbuild()Build the flag container.Add a flag instance to the flag container.
-
Constructor Details
-
FlagContainerBuilder
Construct a new flag container using the provided flag qualified name as the JSON key.- Parameters:
jsonKeyIndex- the qualified name index of the JSON key ornullif no JSON key is configured
-
-
Method Details
-
flag
Description copied from interface:IFlagContainerBuilderAdd a flag instance to the flag container.- Specified by:
flagin interfaceIFlagContainerBuilder<T extends IFlagInstance>- Parameters:
instance- the flag instance to add- Returns:
- this builder
-
build
Description copied from interface:IFlagContainerBuilderBuild the flag container.- Specified by:
buildin interfaceIFlagContainerBuilder<T extends IFlagInstance>- Returns:
- the built flag container
-