Package io.helidon.common.context.http
Class ContextRecordConfig.BuilderBase<BUILDER extends ContextRecordConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends ContextRecordConfig>
java.lang.Object
io.helidon.common.context.http.ContextRecordConfig.BuilderBase<BUILDER,PROTOTYPE>
- 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> ConfigBuilderSupport.ConfiguredBuilder<BUILDER,
,PROTOTYPE> ConfigBuilderSupport.ConfiguredBuilder<BUILDER,
PROTOTYPE>
- Direct Known Subclasses:
ContextRecordConfig.Builder
- Enclosing interface:
ContextRecordConfig
public abstract static class ContextRecordConfig.BuilderBase<BUILDER extends ContextRecordConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends ContextRecordConfig>
extends Object
implements ConfigBuilderSupport.ConfiguredBuilder<BUILDER,PROTOTYPE>
Fluent API builder base for
ContextRecordConfig
.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
Generated implementation of the prototype, can be extended by descendant prototype implementations. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddDefaultValue
(String defaultValue) Default values to send if not configured in context.addDefaultValues
(List<String> defaultValues) Default values to send if not configured in context.boolean
array()
Whether to treat the option as an array of strings.array
(boolean array) Whether to treat the option as an array of strings.String classifier of the value that will be used withContext.get(Object, Class)
.classifier
(String classifier) String classifier of the value that will be used withContext.get(Object, Class)
.Clear existing value of this property.Clear existing value of this property.config()
If this instance was configured, this would be the config instance used.Deprecated.Update builder from configuration (node of this type).Default value to send if not configured in context.defaultValue
(String defaultValue) Default value to send if not configured in context.Default values to send if not configured in context.defaultValues
(List<String> defaultValues) Default values to send if not configured in context.from
(ContextRecordConfig prototype) Update this builder from an existing prototype instance.from
(ContextRecordConfig.BuilderBase<?, ?> builder) Update this builder from an existing prototype builder instance.header()
Name of the header to use when sending the context value over the network.header
(HeaderName header) Name of the header to use when sending the context value over the network.protected void
Handles providers and decorators.toString()
protected void
Validates required properties.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods 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
-
config
Deprecated.Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.- Specified by:
config
in interfaceConfigBuilderSupport.ConfiguredBuilder<BUILDER extends ContextRecordConfig.BuilderBase<BUILDER,
PROTOTYPE>, PROTOTYPE extends ContextRecordConfig> - Parameters:
config
- configuration instance used to obtain values to update this builder- Returns:
- updated builder instance
-
config
Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.- Specified by:
config
in interfaceConfigBuilderSupport.ConfiguredBuilder<BUILDER extends ContextRecordConfig.BuilderBase<BUILDER,
PROTOTYPE>, PROTOTYPE extends ContextRecordConfig> - Parameters:
config
- configuration instance used to obtain values to update this builder- Returns:
- updated builder instance
-
header
Name of the header to use when sending the context value over the network.- Parameters:
header
- header name- Returns:
- updated builder instance
- See Also:
-
clearClassifier
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
classifier
String classifier of the value that will be used withContext.get(Object, Class)
.- Parameters:
classifier
- classifier to use, defaults to header name- Returns:
- updated builder instance
- See Also:
-
clearDefaultValue
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
defaultValue
Default value to send if not configured in context.- Parameters:
defaultValue
- default value, used for non-array records, or when only a single value is desired as a default for array- Returns:
- updated builder instance
- See Also:
-
defaultValues
Default values to send if not configured in context. In case default values is an empty array, it will not be sent over the network if not present in context.- Parameters:
defaultValues
- default values, used for array records; if this record is not an array, only the first value will be used- Returns:
- updated builder instance
- See Also:
-
addDefaultValues
Default values to send if not configured in context. In case default values is an empty array, it will not be sent over the network if not present in context.- Parameters:
defaultValues
- default values, used for array records; if this record is not an array, only the first value will be used- Returns:
- updated builder instance
- See Also:
-
addDefaultValue
Default values to send if not configured in context. In case default values is an empty array, it will not be sent over the network if not present in context.- Parameters:
defaultValue
- default values, used for array records; if this record is not an array, only the first value will be used- Returns:
- updated builder instance
- See Also:
-
array
Whether to treat the option as an array of strings. This would be read from the context as an array.- Parameters:
array
- whether the record is an array- Returns:
- updated builder instance
- See Also:
-
header
Name of the header to use when sending the context value over the network.- Returns:
- the header
-
classifier
String classifier of the value that will be used withContext.get(Object, Class)
.- Returns:
- the classifier
-
defaultValue
Default value to send if not configured in context.- Returns:
- the default value
-
defaultValues
Default values to send if not configured in context. In case default values is an empty array, it will not be sent over the network if not present in context.- Returns:
- the default values
-
array
public boolean array()Whether to treat the option as an array of strings. This would be read from the context as an array.- Returns:
- the array
-
config
If this instance was configured, this would be the config instance used.- Returns:
- config node used to configure this builder, or empty if not configured
-
toString
-
preBuildPrototype
protected void preBuildPrototype()Handles providers and decorators. -
validatePrototype
protected void validatePrototype()Validates required properties.
-
config(io.helidon.config.Config)