Skip to main content

DefinitionsBuilder

No overview available.

Attributes

AttributeTypeDescription
definitionsDefinitions< T >A collection of type definitions used to store and manage the schema components being built.
use_prebuiltboolA flag indicating whether the builder should utilize existing prebuilt definitions instead of generating new ones.

Constructor

Signature

def DefinitionsBuilder(
definitions: Definitions< T >,
use_prebuilt: bool
) - > [DefinitionsBuilder](definitionsbuilder.md?sid=definitions_definitionsbuilder)

Parameters

NameTypeDescription
definitionsDefinitions< T >A collection of definitions to be used by the builder.
use_prebuiltboolA boolean flag indicating if prebuilt definitions should be utilized.

Signature

@classmethod
def new() - > DefinitionsBuilder< T >

Methods


with_prebuilt()

def with_prebuilt(
use_prebuilt: bool
) - > DefinitionsBuilder< T >

Configures whether the builder should utilize prebuilt definitions during the construction process.

Parameters

NameTypeDescription
use_prebuiltboolA flag indicating if pre-existing definitions should be incorporated.

Returns

TypeDescription
DefinitionsBuilder< T >The builder instance with the updated prebuilt configuration.

add_definition()

def add_definition(
definition: T
) - > DefinitionsBuilder< T >

Registers a new definition entry into the builder's internal collection.

Parameters

NameTypeDescription
definitionTThe definition object or value to be stored in the collection.

Returns

TypeDescription
DefinitionsBuilder< T >The builder instance containing the newly added definition.

build()

def build() - > Definitions< T >

Consumes the builder and returns the finalized Definitions object.

Returns

TypeDescription
Definitions< T >The completed definitions collection ready for use.