Class PrototypeInfo.BuilderBase<BUILDER extends PrototypeInfo.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends PrototypeInfo>
- Type Parameters:
BUILDER- type of the builder extending this abstract builderPROTOTYPE- type of the prototype interface that would be built byPrototype.Builder.buildPrototype()
- All Implemented Interfaces:
Prototype.Builder<BUILDER,PROTOTYPE>
- Direct Known Subclasses:
PrototypeInfo.Builder
- Enclosing interface:
PrototypeInfo
PrototypeInfo.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classGenerated implementation of the prototype, can be extended by descendant prototype implementations. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAccess modifier for the generated prototype.accessModifier(AccessModifier accessModifier) Access modifier for the generated prototype.addAnnotation(Annotation annotation) Annotations option.addAnnotation(Consumer<Annotation.Builder> consumer) Annotations option.addAnnotations(List<? extends Annotation> annotations) Annotations option.addBuilderMethod(GeneratedMethod builderMethod) Additional methods to be added to the prototype builder base.addBuilderMethod(Consumer<GeneratedMethod.Builder> consumer) Additional methods to be added to the prototype builder base.addBuilderMethods(List<? extends GeneratedMethod> builderMethods) Additional methods to be added to the prototype builder base.addConfigFactories(List<? extends FactoryMethod> configFactories) Factory methods to be used when mapping config to types.addConfigFactory(FactoryMethod configFactory) Factory methods to be used when mapping config to types.addConfigFactory(Consumer<FactoryMethod.Builder> consumer) Factory methods to be used when mapping config to types.addConstant(PrototypeConstant constant) Constants to be defined on the prototype.addConstant(Consumer<PrototypeConstant.Builder> consumer) Constants to be defined on the prototype.addConstants(List<? extends PrototypeConstant> constants) Constants to be defined on the prototype.addDeprecatedFactoryMethods(List<? extends DeprecatedFactoryMethod> deprecatedFactoryMethods) Deprecated, for removal: This API element is subject to removal in a future version.addInheritedAnnotation(Annotation inheritedAnnotation) InheritedAnnotations option.addInheritedAnnotation(Consumer<Annotation.Builder> consumer) InheritedAnnotations option.addInheritedAnnotations(List<? extends Annotation> inheritedAnnotations) InheritedAnnotations option.addPrototypeFactories(List<? extends GeneratedMethod> prototypeFactories) Static factory methods to be added to the prototype.addPrototypeFactory(GeneratedMethod prototypeFactory) Static factory methods to be added to the prototype.addPrototypeFactory(Consumer<GeneratedMethod.Builder> consumer) Static factory methods to be added to the prototype.addPrototypeMethod(GeneratedMethod prototypeMethod) Additional methods to be added to the prototype as default methods.addPrototypeMethod(Consumer<GeneratedMethod.Builder> consumer) Additional methods to be added to the prototype as default methods.addPrototypeMethods(List<? extends GeneratedMethod> prototypeMethods) Additional methods to be added to the prototype as default methods.addProviderProvide(TypeName providerProvide) Types the generated prototype should provide, if this prototype is/configures a service provider.addProviderProvide(Consumer<TypeName.Builder> consumer) Types the generated prototype should provide, if this prototype is/configures a service provider.addProviderProvides(Set<? extends TypeName> providerProvides) Types the generated prototype should provide, if this prototype is/configures a service provider.addRuntimeTypeFactories(List<? extends RuntimeTypeInfo> runtimeTypeFactories) Factory methods to create runtime types from a builder.addRuntimeTypeFactory(RuntimeTypeInfo runtimeTypeFactory) Factory methods to create runtime types from a builder.addRuntimeTypeFactory(Consumer<RuntimeTypeInfo.Builder> consumer) Factory methods to create runtime types from a builder.addSuperType(TypeName superType) List of types the prototype should extend.addSuperType(Consumer<TypeName.Builder> consumer) List of types the prototype should extend.addSuperTypes(Set<? extends TypeName> superTypes) List of types the prototype should extend.Annotations option.annotations(List<? extends Annotation> annotations) Annotations option.Blueprint type info.Blueprint type info.blueprint(Consumer<TypeInfo.Builder> consumer) Blueprint type info.Blueprint type info.Access modifier for the generated builder.builderAccessModifier(AccessModifier builderAccessModifier) Access modifier for the generated builder.Javadoc for the builder base.builderBaseJavadoc(Javadoc builderBaseJavadoc) Javadoc for the builder base.builderBaseJavadoc(Consumer<Javadoc.Builder> consumer) Javadoc for the builder base.builderBaseJavadoc(Supplier<? extends Javadoc> supplier) Javadoc for the builder base.Builder decorator, if configured.builderDecorator(TypeName builderDecorator) Builder decorator, if configured.builderDecorator(Consumer<TypeName.Builder> consumer) Builder decorator, if configured.builderDecorator(Supplier<? extends TypeName> supplier) Builder decorator, if configured.Javadoc for the builder class.builderJavadoc(Javadoc builderJavadoc) Javadoc for the builder class.builderJavadoc(Consumer<Javadoc.Builder> consumer) Javadoc for the builder class.builderJavadoc(Supplier<? extends Javadoc> supplier) Javadoc for the builder class.Additional methods to be added to the prototype builder base.builderMethods(List<? extends GeneratedMethod> builderMethods) Additional methods to be added to the prototype builder base.Clear all annotations.Clear existing value of builderDecorator.Clear all builderMethods.Clear all configFactories.Clear existing value of configured.Clear all constants.Deprecated, for removal: This API element is subject to removal in a future version.useprototypeFactories(), orruntimeTypeFactories(), orconfigFactories()instead, only present for backwards compatibilityClear all inheritedAnnotations.Clear all prototypeFactories.Clear all prototypeMethods.Clear all providerProvides.Clear existing value of runtimeType.Clear all runtimeTypeFactories.Clear existing value of superPrototype.Clear all superTypes.Factory methods to be used when mapping config to types.configFactories(List<? extends FactoryMethod> configFactories) Factory methods to be used when mapping config to types.Prototype configuration details.configured(PrototypeConfigured configured) Prototype configuration details.configured(Consumer<PrototypeConfigured.Builder> consumer) Prototype configuration details.configured(Supplier<? extends PrototypeConfigured> supplier) Prototype configuration details.Constants to be defined on the prototype.constants(List<? extends PrototypeConstant> constants) Constants to be defined on the prototype.booleanWhether to create an emptycreate()method.createEmptyCreate(boolean createEmptyCreate) Whether to create an emptycreate()method.A predicate to include possible interface default methods as options.defaultMethodsPredicate(Predicate<String> defaultMethodsPredicate) A predicate to include possible interface default methods as options.Deprecated, for removal: This API element is subject to removal in a future version.useprototypeFactories(), orruntimeTypeFactories(), orconfigFactories()instead, only present for backwards compatibilitydeprecatedFactoryMethods(List<? extends DeprecatedFactoryMethod> deprecatedFactoryMethods) Deprecated, for removal: This API element is subject to removal in a future version.useprototypeFactories(), orruntimeTypeFactories(), orconfigFactories()instead, only present for backwards compatibilitybooleanWhether to detach the blueprint from the generated prototype.detachBlueprint(boolean detachBlueprint) Whether to detach the blueprint from the generated prototype.from(PrototypeInfo prototype) Update this builder from an existing prototype instance.from(PrototypeInfo.BuilderBase<?, ?> builder) Update this builder from an existing prototype builder instance.InheritedAnnotations option.inheritedAnnotations(List<? extends Annotation> inheritedAnnotations) InheritedAnnotations option.javadoc()Javadoc for the generated prototype.Javadoc for the generated prototype.javadoc(Consumer<Javadoc.Builder> consumer) Javadoc for the generated prototype.Javadoc for the generated prototype.protected voidHandles providers and decorators.Static factory methods to be added to the prototype.prototypeFactories(List<? extends GeneratedMethod> prototypeFactories) Static factory methods to be added to the prototype.Additional methods to be added to the prototype as default methods.prototypeMethods(List<? extends GeneratedMethod> prototypeMethods) Additional methods to be added to the prototype as default methods.Type name of the generated prototype interface.prototypeType(TypeName prototypeType) Type name of the generated prototype interface.prototypeType(Consumer<TypeName.Builder> consumer) Type name of the generated prototype interface.prototypeType(Supplier<? extends TypeName> supplier) Type name of the generated prototype interface.Types the generated prototype should provide, if this prototype is/configures a service provider.providerProvides(Set<? extends TypeName> providerProvides) Types the generated prototype should provide, if this prototype is/configures a service provider.booleanWhether to use record style or bean style accessors.recordStyle(boolean recordStyle) Whether to use record style or bean style accessors.booleanWhether to use the service registry to discover providers.registrySupport(boolean registrySupport) Whether to use the service registry to discover providers.If the builder should act as a factory for another type, this is the type.runtimeType(TypeName runtimeType) If the builder should act as a factory for another type, this is the type.runtimeType(Consumer<TypeName.Builder> consumer) If the builder should act as a factory for another type, this is the type.runtimeType(Supplier<? extends TypeName> supplier) If the builder should act as a factory for another type, this is the type.Factory methods to create runtime types from a builder.runtimeTypeFactories(List<? extends RuntimeTypeInfo> runtimeTypeFactories) Factory methods to create runtime types from a builder.If the blueprint extends an existing prototype (or blueprint), we must extend that prototype and also that prototype's builder.superPrototype(TypeName superPrototype) If the blueprint extends an existing prototype (or blueprint), we must extend that prototype and also that prototype's builder.superPrototype(Consumer<TypeName.Builder> consumer) If the blueprint extends an existing prototype (or blueprint), we must extend that prototype and also that prototype's builder.superPrototype(Supplier<? extends TypeName> supplier) If the blueprint extends an existing prototype (or blueprint), we must extend that prototype and also that prototype's builder.List of types the prototype should extend.superTypes(Set<? extends TypeName> superTypes) List of types the prototype should extend.toString()protected voidValidates required properties.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.helidon.builder.api.Prototype.Builder
buildPrototype, self
-
Constructor Details
-
BuilderBase
protected BuilderBase()Protected to support extensibility.
-
-
Method Details
-
from
Update this builder from an existing prototype instance. This method disables automatic service discovery.- Parameters:
prototype- existing prototype to update this builder from- Returns:
- updated builder instance
-
from
Update this builder from an existing prototype builder instance.- Parameters:
builder- existing builder prototype to update this builder from- Returns:
- updated builder instance
-
blueprint
Blueprint type info. A new prototype cannot be generated without a blueprint to base it on, so this is a required option.- Parameters:
blueprint- blueprint type information- Returns:
- updated builder instance
- See Also:
-
blueprint
Blueprint type info. A new prototype cannot be generated without a blueprint to base it on, so this is a required option.- Parameters:
consumer- consumer of builder of blueprint type information- Returns:
- updated builder instance
- See Also:
-
blueprint
Blueprint type info. A new prototype cannot be generated without a blueprint to base it on, so this is a required option.- Parameters:
supplier- supplier of blueprint type information- Returns:
- updated builder instance
- See Also:
-
clearRuntimeType
Clear existing value of runtimeType.- Returns:
- updated builder instance
- See Also:
-
runtimeType
If the builder should act as a factory for another type, this is the type.Method
Prototype.Builder.buildPrototype()builds the prototype, while methodBuilder.build()builds the runtime type.- Parameters:
runtimeType- runtime type, if configured- Returns:
- updated builder instance
- See Also:
-
runtimeType
If the builder should act as a factory for another type, this is the type.Method
Prototype.Builder.buildPrototype()builds the prototype, while methodBuilder.build()builds the runtime type.- Parameters:
consumer- consumer of builder of runtime type, if configured- Returns:
- updated builder instance
- See Also:
-
runtimeType
If the builder should act as a factory for another type, this is the type.Method
Prototype.Builder.buildPrototype()builds the prototype, while methodBuilder.build()builds the runtime type.- Parameters:
supplier- supplier of runtime type, if configured- Returns:
- updated builder instance
- See Also:
-
javadoc
Javadoc for the generated prototype.- Parameters:
javadoc- prototype javadoc- Returns:
- updated builder instance
- See Also:
-
javadoc
Javadoc for the generated prototype.- Parameters:
consumer- consumer of builder of prototype javadoc- Returns:
- updated builder instance
- See Also:
-
javadoc
Javadoc for the generated prototype.- Parameters:
supplier- supplier of prototype javadoc- Returns:
- updated builder instance
- See Also:
-
builderBaseJavadoc
Javadoc for the builder base.- Parameters:
builderBaseJavadoc- builder base javadoc- Returns:
- updated builder instance
- See Also:
-
builderBaseJavadoc
Javadoc for the builder base.- Parameters:
consumer- consumer of builder of builder base javadoc- Returns:
- updated builder instance
- See Also:
-
builderBaseJavadoc
Javadoc for the builder base.- Parameters:
supplier- supplier of builder base javadoc- Returns:
- updated builder instance
- See Also:
-
builderJavadoc
Javadoc for the builder class.- Parameters:
builderJavadoc- builder javadoc- Returns:
- updated builder instance
- See Also:
-
builderJavadoc
Javadoc for the builder class.- Parameters:
consumer- consumer of builder of builder javadoc- Returns:
- updated builder instance
- See Also:
-
builderJavadoc
Javadoc for the builder class.- Parameters:
supplier- supplier of builder javadoc- Returns:
- updated builder instance
- See Also:
-
clearBuilderDecorator
Clear existing value of builderDecorator.- Returns:
- updated builder instance
- See Also:
-
builderDecorator
Builder decorator, if configured.- Parameters:
builderDecorator- type of the builder decorator, if present- Returns:
- updated builder instance
- See Also:
-
builderDecorator
Builder decorator, if configured.- Parameters:
consumer- consumer of builder of type of the builder decorator, if present- Returns:
- updated builder instance
- See Also:
-
builderDecorator
Builder decorator, if configured.- Parameters:
supplier- supplier of type of the builder decorator, if present- Returns:
- updated builder instance
- See Also:
-
prototypeType
Type name of the generated prototype interface.This interface will contain the following inner classes:
BuilderBase- base of the builder with all setters, to support prototype inheritanceBuilder- builder extending the builder base that builds the prototype instance- implementation - prototype implementation class, supports inheritance as well
- Parameters:
prototypeType- type of the prototype interface- Returns:
- updated builder instance
- See Also:
-
prototypeType
Type name of the generated prototype interface.This interface will contain the following inner classes:
BuilderBase- base of the builder with all setters, to support prototype inheritanceBuilder- builder extending the builder base that builds the prototype instance- implementation - prototype implementation class, supports inheritance as well
- Parameters:
consumer- consumer of builder of type of the prototype interface- Returns:
- updated builder instance
- See Also:
-
prototypeType
Type name of the generated prototype interface.This interface will contain the following inner classes:
BuilderBase- base of the builder with all setters, to support prototype inheritanceBuilder- builder extending the builder base that builds the prototype instance- implementation - prototype implementation class, supports inheritance as well
- Parameters:
supplier- supplier of type of the prototype interface- Returns:
- updated builder instance
- See Also:
-
defaultMethodsPredicate
A predicate to include possible interface default methods as options. The default behavior is to exclude all default methods.Sequence of checking if a default method should be an option method:
- Check the method signature (i.e.
process(java.lang.String), if accepted, use it as an option - Check the method name (i.e.
process, if accepted, use it as an option - Otherwise the default method will not be an option
- Parameters:
defaultMethodsPredicate- predicate for method names- Returns:
- updated builder instance
- See Also:
- Check the method signature (i.e.
-
accessModifier
Access modifier for the generated prototype.- Parameters:
accessModifier- access modifier, defaults topublic- Returns:
- updated builder instance
- See Also:
-
builderAccessModifier
Access modifier for the generated builder.- Parameters:
builderAccessModifier- access modifier, defaults topublic- Returns:
- updated builder instance
- See Also:
-
createEmptyCreate
Whether to create an emptycreate()method.- Parameters:
createEmptyCreate- whether to create an emptycreate()method, defaults totrue- Returns:
- updated builder instance
- See Also:
-
recordStyle
Whether to use record style or bean style accessors.Let's consider option
accessModifierof typeAccessModifier.Record style:
- Getter:
AccessModifier accessModifier() - Setter:
Builder accessModifier(AccessModifier)
- Getter:
AccessModifier getAccessModifier() - Setter:
Builder setAccessModifier(AccessModifier)
- Parameters:
recordStyle- whether to use record style accessors, defaults totrue- Returns:
- updated builder instance
- See Also:
- Getter:
-
clearConfigured
Clear existing value of configured.- Returns:
- updated builder instance
- See Also:
-
configured
Prototype configuration details.- Parameters:
configured- prototype configuration details, if configured- Returns:
- updated builder instance
- See Also:
-
configured
Prototype configuration details.- Parameters:
consumer- consumer of builder of prototype configuration details, if configured- Returns:
- updated builder instance
- See Also:
-
configured
Prototype configuration details.- Parameters:
supplier- supplier of prototype configuration details, if configured- Returns:
- updated builder instance
- See Also:
-
registrySupport
Whether to use the service registry to discover providers.- Parameters:
registrySupport- whether to support service registry, defaults tofalse- Returns:
- updated builder instance
- See Also:
-
detachBlueprint
Whether to detach the blueprint from the generated prototype.- Parameters:
detachBlueprint- true if the blueprint should not be extended by the prototype- Returns:
- updated builder instance
- See Also:
-
clearSuperPrototype
Clear existing value of superPrototype.- Returns:
- updated builder instance
- See Also:
-
superPrototype
If the blueprint extends an existing prototype (or blueprint), we must extend that prototype and also that prototype's builder.- Parameters:
superPrototype- super prototype, if present- Returns:
- updated builder instance
- See Also:
-
superPrototype
If the blueprint extends an existing prototype (or blueprint), we must extend that prototype and also that prototype's builder.- Parameters:
consumer- consumer of builder of super prototype, if present- Returns:
- updated builder instance
- See Also:
-
superPrototype
If the blueprint extends an existing prototype (or blueprint), we must extend that prototype and also that prototype's builder.- Parameters:
supplier- supplier of super prototype, if present- Returns:
- updated builder instance
- See Also:
-
clearSuperTypes
Clear all superTypes.- Returns:
- updated builder instance
- See Also:
-
superTypes
List of types the prototype should extend. This list will always contain the blueprint interface, andPrototype.Api. This list also containssuperPrototype()if present.- Parameters:
superTypes- types the prototype must extend- Returns:
- updated builder instance
- See Also:
-
addSuperTypes
List of types the prototype should extend. This list will always contain the blueprint interface, andPrototype.Api. This list also containssuperPrototype()if present.- Parameters:
superTypes- types the prototype must extend- Returns:
- updated builder instance
- See Also:
-
addSuperType
List of types the prototype should extend. This list will always contain the blueprint interface, andPrototype.Api. This list also containssuperPrototype()if present.- Parameters:
superType- add single types the prototype must extend- Returns:
- updated builder instance
- See Also:
-
addSuperType
List of types the prototype should extend. This list will always contain the blueprint interface, andPrototype.Api. This list also containssuperPrototype()if present.- Parameters:
consumer- consumer of builder for types the prototype must extend- Returns:
- updated builder instance
- See Also:
-
clearProviderProvides
Clear all providerProvides.- Returns:
- updated builder instance
- See Also:
-
providerProvides
Types the generated prototype should provide, if this prototype is/configures a service provider.- Parameters:
providerProvides- provider provides types- Returns:
- updated builder instance
- See Also:
-
addProviderProvides
Types the generated prototype should provide, if this prototype is/configures a service provider.- Parameters:
providerProvides- provider provides types- Returns:
- updated builder instance
- See Also:
-
addProviderProvide
Types the generated prototype should provide, if this prototype is/configures a service provider.- Parameters:
providerProvide- add single provider provides types- Returns:
- updated builder instance
- See Also:
-
addProviderProvide
Types the generated prototype should provide, if this prototype is/configures a service provider.- Parameters:
consumer- consumer of builder for provider provides types- Returns:
- updated builder instance
- See Also:
-
clearConstants
Clear all constants.- Returns:
- updated builder instance
- See Also:
-
constants
Constants to be defined on the prototype. A constant may be either a reference to another constant or a generated value.- Parameters:
constants- constants to add to the prototype- Returns:
- updated builder instance
- See Also:
-
addConstants
Constants to be defined on the prototype. A constant may be either a reference to another constant or a generated value.- Parameters:
constants- constants to add to the prototype- Returns:
- updated builder instance
- See Also:
-
addConstant
Constants to be defined on the prototype. A constant may be either a reference to another constant or a generated value.- Parameters:
constant- add single constants to add to the prototype- Returns:
- updated builder instance
- See Also:
-
addConstant
Constants to be defined on the prototype. A constant may be either a reference to another constant or a generated value.- Parameters:
consumer- consumer of builder for constants to add to the prototype- Returns:
- updated builder instance
- See Also:
-
clearPrototypeMethods
Clear all prototypeMethods.- Returns:
- updated builder instance
- See Also:
-
prototypeMethods
Additional methods to be added to the prototype as default methods.Non-default interface methods cannot be added, as the implementation is not customizable. This list does NOT contain option methods.
- Parameters:
prototypeMethods- custom methods to add to the prototype- Returns:
- updated builder instance
- See Also:
-
addPrototypeMethods
Additional methods to be added to the prototype as default methods.Non-default interface methods cannot be added, as the implementation is not customizable. This list does NOT contain option methods.
- Parameters:
prototypeMethods- custom methods to add to the prototype- Returns:
- updated builder instance
- See Also:
-
addPrototypeMethod
Additional methods to be added to the prototype as default methods.Non-default interface methods cannot be added, as the implementation is not customizable. This list does NOT contain option methods.
- Parameters:
prototypeMethod- add single custom methods to add to the prototype- Returns:
- updated builder instance
- See Also:
-
addPrototypeMethod
Additional methods to be added to the prototype as default methods.Non-default interface methods cannot be added, as the implementation is not customizable. This list does NOT contain option methods.
- Parameters:
consumer- consumer of builder for custom methods to add to the prototype- Returns:
- updated builder instance
- See Also:
-
clearBuilderMethods
Clear all builderMethods.- Returns:
- updated builder instance
- See Also:
-
builderMethods
Additional methods to be added to the prototype builder base. It is your responsibility to ensure these methods do not conflict with option methods. This list does NOT contain option methods.- Parameters:
builderMethods- custom methods to add to the prototype builder base- Returns:
- updated builder instance
- See Also:
-
addBuilderMethods
Additional methods to be added to the prototype builder base. It is your responsibility to ensure these methods do not conflict with option methods. This list does NOT contain option methods.- Parameters:
builderMethods- custom methods to add to the prototype builder base- Returns:
- updated builder instance
- See Also:
-
addBuilderMethod
Additional methods to be added to the prototype builder base. It is your responsibility to ensure these methods do not conflict with option methods. This list does NOT contain option methods.- Parameters:
builderMethod- add single custom methods to add to the prototype builder base- Returns:
- updated builder instance
- See Also:
-
addBuilderMethod
Additional methods to be added to the prototype builder base. It is your responsibility to ensure these methods do not conflict with option methods. This list does NOT contain option methods.- Parameters:
consumer- consumer of builder for custom methods to add to the prototype builder base- Returns:
- updated builder instance
- See Also:
-
clearDeprecatedFactoryMethods
Deprecated, for removal: This API element is subject to removal in a future version.useprototypeFactories(), orruntimeTypeFactories(), orconfigFactories()instead, only present for backwards compatibilityClear all deprecatedFactoryMethods.- Returns:
- updated builder instance
- See Also:
-
deprecatedFactoryMethods
@Deprecated(since="4.4.0", forRemoval=true) public BUILDER deprecatedFactoryMethods(List<? extends DeprecatedFactoryMethod> deprecatedFactoryMethods) Deprecated, for removal: This API element is subject to removal in a future version.useprototypeFactories(), orruntimeTypeFactories(), orconfigFactories()instead, only present for backwards compatibilityStatic factory methods to be added to the prototype, or runtime type factory methods.This method exists only for backwards compatibility and will be removed in a future major version.
- Parameters:
deprecatedFactoryMethods- a list of factory methods declared on the blueprint or a reference custom methods type- Returns:
- updated builder instance
- See Also:
-
addDeprecatedFactoryMethods
@Deprecated(since="4.4.0", forRemoval=true) public BUILDER addDeprecatedFactoryMethods(List<? extends DeprecatedFactoryMethod> deprecatedFactoryMethods) Deprecated, for removal: This API element is subject to removal in a future version.useprototypeFactories(), orruntimeTypeFactories(), orconfigFactories()instead, only present for backwards compatibilityStatic factory methods to be added to the prototype, or runtime type factory methods.This method exists only for backwards compatibility and will be removed in a future major version.
- Parameters:
deprecatedFactoryMethods- a list of factory methods declared on the blueprint or a reference custom methods type- Returns:
- updated builder instance
- See Also:
-
clearPrototypeFactories
Clear all prototypeFactories.- Returns:
- updated builder instance
- See Also:
-
prototypeFactories
Static factory methods to be added to the prototype.- Parameters:
prototypeFactories- a list of factory methods to add to the prototype- Returns:
- updated builder instance
- See Also:
-
addPrototypeFactories
Static factory methods to be added to the prototype.- Parameters:
prototypeFactories- a list of factory methods to add to the prototype- Returns:
- updated builder instance
- See Also:
-
addPrototypeFactory
Static factory methods to be added to the prototype.- Parameters:
prototypeFactory- add single a list of factory methods to add to the prototype- Returns:
- updated builder instance
- See Also:
-
addPrototypeFactory
Static factory methods to be added to the prototype.- Parameters:
consumer- consumer of builder for a list of factory methods to add to the prototype- Returns:
- updated builder instance
- See Also:
-
clearConfigFactories
Clear all configFactories.- Returns:
- updated builder instance
- See Also:
-
configFactories
Factory methods to be used when mapping config to types. These methods will never be made public.Config factory methods may exist for a specific option, or for any option that matches the type.
- Parameters:
configFactories- factory methods to use when mapping config to types- Returns:
- updated builder instance
- See Also:
-
addConfigFactories
Factory methods to be used when mapping config to types. These methods will never be made public.Config factory methods may exist for a specific option, or for any option that matches the type.
- Parameters:
configFactories- factory methods to use when mapping config to types- Returns:
- updated builder instance
- See Also:
-
addConfigFactory
Factory methods to be used when mapping config to types. These methods will never be made public.Config factory methods may exist for a specific option, or for any option that matches the type.
- Parameters:
configFactory- add single factory methods to use when mapping config to types- Returns:
- updated builder instance
- See Also:
-
addConfigFactory
Factory methods to be used when mapping config to types. These methods will never be made public.Config factory methods may exist for a specific option, or for any option that matches the type.
- Parameters:
consumer- consumer of builder for factory methods to use when mapping config to types- Returns:
- updated builder instance
- See Also:
-
clearRuntimeTypeFactories
Clear all runtimeTypeFactories.- Returns:
- updated builder instance
- See Also:
-
runtimeTypeFactories
Factory methods to create runtime types from a builder. If a method is available for a specific option and matches its types, a setter with a parameter of consumer of the builder type will be added to the builder base.Runtime factory methods may exist for a specific option, or for any option that matches the type.
- Parameters:
runtimeTypeFactories- factory methods to create runtime types from a builder- Returns:
- updated builder instance
- See Also:
-
addRuntimeTypeFactories
Factory methods to create runtime types from a builder. If a method is available for a specific option and matches its types, a setter with a parameter of consumer of the builder type will be added to the builder base.Runtime factory methods may exist for a specific option, or for any option that matches the type.
- Parameters:
runtimeTypeFactories- factory methods to create runtime types from a builder- Returns:
- updated builder instance
- See Also:
-
addRuntimeTypeFactory
Factory methods to create runtime types from a builder. If a method is available for a specific option and matches its types, a setter with a parameter of consumer of the builder type will be added to the builder base.Runtime factory methods may exist for a specific option, or for any option that matches the type.
- Parameters:
runtimeTypeFactory- add single factory methods to create runtime types from a builder- Returns:
- updated builder instance
- See Also:
-
addRuntimeTypeFactory
Factory methods to create runtime types from a builder. If a method is available for a specific option and matches its types, a setter with a parameter of consumer of the builder type will be added to the builder base.Runtime factory methods may exist for a specific option, or for any option that matches the type.
- Parameters:
consumer- consumer of builder for factory methods to create runtime types from a builder- Returns:
- updated builder instance
- See Also:
-
clearAnnotations
Clear all annotations.- Returns:
- updated builder instance
- See Also:
-
annotations
Annotations option. Defined inAnnotated.annotations()- Parameters:
annotations- the annotations option- Returns:
- updated builder instance
- See Also:
-
addAnnotations
Annotations option. Defined inAnnotated.annotations()- Parameters:
annotations- the annotations option- Returns:
- updated builder instance
- See Also:
-
addAnnotation
Annotations option. Defined inAnnotated.annotations()- Parameters:
annotation- add single the annotations option- Returns:
- updated builder instance
- See Also:
-
addAnnotation
Annotations option. Defined inAnnotated.annotations()- Parameters:
consumer- consumer of builder for the annotations option- Returns:
- updated builder instance
- See Also:
-
clearInheritedAnnotations
Clear all inheritedAnnotations.- Returns:
- updated builder instance
- See Also:
-
inheritedAnnotations
InheritedAnnotations option. Defined inAnnotated.inheritedAnnotations()- Parameters:
inheritedAnnotations- the inheritedAnnotations option- Returns:
- updated builder instance
- See Also:
-
addInheritedAnnotations
InheritedAnnotations option. Defined inAnnotated.inheritedAnnotations()- Parameters:
inheritedAnnotations- the inheritedAnnotations option- Returns:
- updated builder instance
- See Also:
-
addInheritedAnnotation
InheritedAnnotations option. Defined inAnnotated.inheritedAnnotations()- Parameters:
inheritedAnnotation- add single the inheritedAnnotations option- Returns:
- updated builder instance
- See Also:
-
addInheritedAnnotation
InheritedAnnotations option. Defined inAnnotated.inheritedAnnotations()- Parameters:
consumer- consumer of builder for the inheritedAnnotations option- Returns:
- updated builder instance
- See Also:
-
blueprint
Blueprint type info. A new prototype cannot be generated without a blueprint to base it on, so this is a required option.- Returns:
- blueprint type information
-
runtimeType
If the builder should act as a factory for another type, this is the type.Method
Prototype.Builder.buildPrototype()builds the prototype, while methodBuilder.build()builds the runtime type.- Returns:
- runtime type, if configured
-
javadoc
Javadoc for the generated prototype.- Returns:
- prototype javadoc
-
builderBaseJavadoc
Javadoc for the builder base.- Returns:
- builder base javadoc
-
builderJavadoc
Javadoc for the builder class.- Returns:
- builder javadoc
-
builderDecorator
Builder decorator, if configured.- Returns:
- type of the builder decorator, if present
-
prototypeType
Type name of the generated prototype interface.This interface will contain the following inner classes:
BuilderBase- base of the builder with all setters, to support prototype inheritanceBuilder- builder extending the builder base that builds the prototype instance- implementation - prototype implementation class, supports inheritance as well
- Returns:
- type of the prototype interface
-
defaultMethodsPredicate
A predicate to include possible interface default methods as options. The default behavior is to exclude all default methods.Sequence of checking if a default method should be an option method:
- Check the method signature (i.e.
process(java.lang.String), if accepted, use it as an option - Check the method name (i.e.
process, if accepted, use it as an option - Otherwise the default method will not be an option
- Returns:
- predicate for method names
- Check the method signature (i.e.
-
accessModifier
Access modifier for the generated prototype.- Returns:
- access modifier, defaults to
public
-
builderAccessModifier
Access modifier for the generated builder.- Returns:
- access modifier, defaults to
public
-
createEmptyCreate
public boolean createEmptyCreate()Whether to create an emptycreate()method.- Returns:
- whether to create an empty
create()method, defaults totrue
-
recordStyle
public boolean recordStyle()Whether to use record style or bean style accessors.Let's consider option
accessModifierof typeAccessModifier.Record style:
- Getter:
AccessModifier accessModifier() - Setter:
Builder accessModifier(AccessModifier)
- Getter:
AccessModifier getAccessModifier() - Setter:
Builder setAccessModifier(AccessModifier)
- Returns:
- whether to use record style accessors, defaults to
true
- Getter:
-
configured
Prototype configuration details.- Returns:
- prototype configuration details, if configured
-
registrySupport
public boolean registrySupport()Whether to use the service registry to discover providers.- Returns:
- whether to support service registry, defaults to
false
-
detachBlueprint
public boolean detachBlueprint()Whether to detach the blueprint from the generated prototype.- Returns:
- true if the blueprint should not be extended by the prototype
-
superPrototype
If the blueprint extends an existing prototype (or blueprint), we must extend that prototype and also that prototype's builder.- Returns:
- super prototype, if present
-
superTypes
List of types the prototype should extend. This list will always contain the blueprint interface, andPrototype.Api. This list also containssuperPrototype()if present.- Returns:
- types the prototype must extend
-
providerProvides
Types the generated prototype should provide, if this prototype is/configures a service provider.- Returns:
- provider provides types
-
constants
Constants to be defined on the prototype. A constant may be either a reference to another constant or a generated value.- Returns:
- constants to add to the prototype
-
prototypeMethods
Additional methods to be added to the prototype as default methods.Non-default interface methods cannot be added, as the implementation is not customizable. This list does NOT contain option methods.
- Returns:
- custom methods to add to the prototype
-
builderMethods
Additional methods to be added to the prototype builder base. It is your responsibility to ensure these methods do not conflict with option methods. This list does NOT contain option methods.- Returns:
- custom methods to add to the prototype builder base
-
deprecatedFactoryMethods
@Deprecated(since="4.4.0", forRemoval=true) public List<DeprecatedFactoryMethod> deprecatedFactoryMethods()Deprecated, for removal: This API element is subject to removal in a future version.useprototypeFactories(), orruntimeTypeFactories(), orconfigFactories()instead, only present for backwards compatibilityStatic factory methods to be added to the prototype, or runtime type factory methods.This method exists only for backwards compatibility and will be removed in a future major version.
- Returns:
- a list of factory methods declared on the blueprint or a reference custom methods type
-
prototypeFactories
Static factory methods to be added to the prototype.- Returns:
- a list of factory methods to add to the prototype
-
configFactories
Factory methods to be used when mapping config to types. These methods will never be made public.Config factory methods may exist for a specific option, or for any option that matches the type.
- Returns:
- factory methods to use when mapping config to types
-
runtimeTypeFactories
Factory methods to create runtime types from a builder. If a method is available for a specific option and matches its types, a setter with a parameter of consumer of the builder type will be added to the builder base.Runtime factory methods may exist for a specific option, or for any option that matches the type.
- Returns:
- factory methods to create runtime types from a builder
-
annotations
Annotations option. Defined inAnnotated.annotations()- Returns:
- the annotations option
-
inheritedAnnotations
InheritedAnnotations option. Defined inAnnotated.inheritedAnnotations()- Returns:
- the inheritedAnnotations option
-
toString
-
preBuildPrototype
protected void preBuildPrototype()Handles providers and decorators. -
validatePrototype
protected void validatePrototype()Validates required properties.
-
prototypeFactories(), orruntimeTypeFactories(), orconfigFactories()instead, only present for backwards compatibility