Module io.helidon.http.media.gson
Package io.helidon.http.media.gson
Class GsonSupportConfig.BuilderBase<BUILDER extends GsonSupportConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends GsonSupportConfig>
java.lang.Object
io.helidon.http.media.MediaSupportConfig.BuilderBase<BUILDER,PROTOTYPE>
io.helidon.http.media.gson.GsonSupportConfig.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:
GsonSupportConfig.Builder
- Enclosing interface:
GsonSupportConfig
public abstract static class GsonSupportConfig.BuilderBase<BUILDER extends GsonSupportConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends GsonSupportConfig>
extends MediaSupportConfig.BuilderBase<BUILDER,PROTOTYPE>
implements ConfigBuilderSupport.ConfiguredBuilder<BUILDER,PROTOTYPE>
Fluent API builder base for
GsonSupportConfig.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classGenerated implementation of the prototype, can be extended by descendant prototype implementations.Nested classes/interfaces inherited from class io.helidon.http.media.MediaSupportConfig.BuilderBase
MediaSupportConfig.BuilderBase.MediaSupportConfigImpl -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddProperties(Map<String, Boolean> properties) Gson configuration properties.addTypeAdapterFactories(List<? extends com.google.gson.TypeAdapterFactory> typeAdapterFactories) Additional type adapter factories.addTypeAdapterFactory(com.google.gson.TypeAdapterFactory typeAdapterFactory) Additional type adapter factories.Clear all typeAdapterFactories.Deprecated.Update builder from configuration (node of this type).from(GsonSupportConfig prototype) Update this builder from an existing prototype instance.from(GsonSupportConfig.BuilderBase<?, ?> builder) Update this builder from an existing prototype builder instance.Optional<com.google.gson.Gson> gson()Gsoninstance.gson(com.google.gson.Gson gson) Gsoninstance.protected voidHandles providers and decorators.Gson configuration properties.properties(Map<String, Boolean> properties) Gson configuration properties.putProperty(String key, Boolean property) Gson configuration properties.Service registry used to discover providers and services.serviceRegistry(ServiceRegistry serviceRegistry) Service registry used to discover providers and services.toString()List<com.google.gson.TypeAdapterFactory> Additional type adapter factories.typeAdapterFactories(List<? extends com.google.gson.TypeAdapterFactory> typeAdapterFactories) Additional type adapter factories.booleanService discovery flag fortypeAdapterFactories().typeAdapterFactoriesDiscoverServices(boolean typeAdapterFactoriesDiscoverServices) Service discovery flag fortypeAdapterFactories().protected voidValidates required properties.Methods inherited from class io.helidon.http.media.MediaSupportConfig.BuilderBase
acceptedMediaTypes, acceptedMediaTypes, addAcceptedMediaType, addAcceptedMediaTypes, clearAcceptedMediaTypes, config, contentType, contentType, contentType, contentType, from, from, name, nameMethods 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
-
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:
configin interfaceConfigBuilderSupport.ConfiguredBuilder<BUILDER extends GsonSupportConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends GsonSupportConfig> - Overrides:
configin classMediaSupportConfig.BuilderBase<BUILDER extends GsonSupportConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends GsonSupportConfig> - 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:
configin interfaceConfigBuilderSupport.ConfiguredBuilder<BUILDER extends GsonSupportConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends GsonSupportConfig> - Overrides:
configin classMediaSupportConfig.BuilderBase<BUILDER extends GsonSupportConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends GsonSupportConfig> - Parameters:
config- configuration instance used to obtain values to update this builder- Returns:
- updated builder instance
-
gson
Gsoninstance.- Parameters:
gson- gson instance- Returns:
- updated builder instance
- See Also:
-
properties
Gson configuration properties. Properties are being ignored if specificGsonis set. Onlybooleanconfiguration values are supported. This method replaces all values with the new ones.- Parameters:
properties- gson config properties- Returns:
- updated builder instance
- See Also:
-
addProperties
Gson configuration properties. Properties are being ignored if specificGsonis set. Onlybooleanconfiguration values are supported. This method keeps existing values, then puts all new values into the map.- Parameters:
properties- gson config properties- Returns:
- updated builder instance
- See Also:
-
putProperty
Gson configuration properties. Properties are being ignored if specificGsonis set. Onlybooleanconfiguration values are supported. This method adds a new value to the map, or replaces it if the key already exists.- Parameters:
key- key to add or replaceproperty- new value for the key- Returns:
- updated builder instance
- See Also:
-
clearTypeAdapterFactories
Clear all typeAdapterFactories.- Returns:
- updated builder instance
- See Also:
-
typeAdapterFactories
public BUILDER typeAdapterFactories(List<? extends com.google.gson.TypeAdapterFactory> typeAdapterFactories) Additional type adapter factories.- Parameters:
typeAdapterFactories- type adapter factories- Returns:
- updated builder instance
- See Also:
-
addTypeAdapterFactories
public BUILDER addTypeAdapterFactories(List<? extends com.google.gson.TypeAdapterFactory> typeAdapterFactories) Additional type adapter factories.- Parameters:
typeAdapterFactories- type adapter factories- Returns:
- updated builder instance
- See Also:
-
addTypeAdapterFactory
Additional type adapter factories.- Parameters:
typeAdapterFactory- add single type adapter factories- Returns:
- updated builder instance
- See Also:
-
typeAdapterFactoriesDiscoverServices
Service discovery flag fortypeAdapterFactories(). If set totrue, services will be discovered from Java service loader, or Helidon ServiceRegistry.- Parameters:
typeAdapterFactoriesDiscoverServices- whether to enable automatic service discovery- Returns:
- updated builder instance
- See Also:
-
serviceRegistry
Service registry used to discover providers and services. Provide an explicit registry instance to use.If not configured, the
GlobalServiceRegistrywould be used to discover services.- Parameters:
serviceRegistry- service registry to use- Returns:
- updated builder instance
- See Also:
-
gson
Gsoninstance.- Returns:
- gson instance
-
properties
Gson configuration properties. Properties are being ignored if specificGsonis set. Onlybooleanconfiguration values are supported.- Returns:
- gson config properties
-
typeAdapterFactories
Additional type adapter factories.- Returns:
- type adapter factories
-
typeAdapterFactoriesDiscoverServices
public boolean typeAdapterFactoriesDiscoverServices()Service discovery flag fortypeAdapterFactories(). If set totrue, services will be discovered from Java service loader, or Helidon ServiceRegistry.- Returns:
- whether to enable automatic service discovery
-
serviceRegistry
Service registry used to discover providers and services. Provide an explicit registry instance to use.If not configured, the
GlobalServiceRegistrywould be used to discover services.- Returns:
- service registry to use
-
toString
- Overrides:
toStringin classMediaSupportConfig.BuilderBase<BUILDER extends GsonSupportConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends GsonSupportConfig>
-
preBuildPrototype
protected void preBuildPrototype()Handles providers and decorators.- Overrides:
preBuildPrototypein classMediaSupportConfig.BuilderBase<BUILDER extends GsonSupportConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends GsonSupportConfig>
-
validatePrototype
protected void validatePrototype()Validates required properties.- Overrides:
validatePrototypein classMediaSupportConfig.BuilderBase<BUILDER extends GsonSupportConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends GsonSupportConfig>
-
config(io.helidon.config.Config)