Package io.helidon.servicecommon.rest
Class HelidonRestServiceSupport.Builder<B extends HelidonRestServiceSupport.Builder<B,T>,T extends HelidonRestServiceSupport>
java.lang.Object
io.helidon.servicecommon.rest.HelidonRestServiceSupport.Builder<B,T>
- Type Parameters:
T
- type of the concrete serviceB
- type of the concrete builder for the service
- Direct Known Subclasses:
HealthSupport.Builder
,MetricsSupport.Builder
,MicrometerSupport.Builder
- Enclosing class:
- HelidonRestServiceSupport
public abstract static class HelidonRestServiceSupport.Builder<B extends HelidonRestServiceSupport.Builder<B,T>,T extends HelidonRestServiceSupport>
extends Object
implements Builder<B,T>
Abstract implementation of a
Builder
for the service.
Concrete implementations may override any of the Builder
methods, particularly
config(Config)
(to load service-specific values from config into the service-specific Builder
).
Such overrides should invoke super.xxx(...)
to take advantage of the common behavior implemented here.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionconfig()
Returns the config (if any) assigned for this builder.Sets the configuration to be used by this builder.crossOriginConfig
(CrossOriginConfig crossOriginConfig) Set the CORS config from the specifiedCrossOriginConfig
object.crossOriginConfig
(CrossOriginConfig.Builder crossOriginConfigBuilder) Set the CORS config from the specifiedCrossOriginConfig
object.restServiceSettings
(RestServiceSettings.Builder restServiceSettingsBuilder) Sets the builder for the REST service settings.webContext
(String path) Set the root context for the REST API of the service.protected Config
webContextConfig
(Config config) Returns the web-contextConfig
node from the provided config.
-
Constructor Details
-
Builder
Creates a new builder using the provided class and default web context.- Parameters:
defaultContext
- default web context for the service
-
-
Method Details
-
config
Sets the configuration to be used by this builder.Concrete builder implementations may override this method but should invoke
super.config(config)
to benefit from the common routing set-up.- Parameters:
config
- the Helidon config instance- Returns:
- updated builder instance
-
config
Returns the config (if any) assigned for this builder.- Returns:
- the Config
-
webContext
Set the root context for the REST API of the service.- Parameters:
path
- context to use- Returns:
- updated builder instance
-
crossOriginConfig
Set the CORS config from the specifiedCrossOriginConfig
object.- Parameters:
crossOriginConfig
-CrossOriginConfig
containing CORS set-up- Returns:
- updated builder instance
-
crossOriginConfig
Set the CORS config from the specifiedCrossOriginConfig
object.- Parameters:
crossOriginConfigBuilder
-CrossOriginConfig.Builder
containing CORS set-up- Returns:
- updated builder instance
-
restServiceSettings
Sets the builder for the REST service settings. This will replace any values configured on this instance and will ONLY use values defined in the provided supplier.- Parameters:
restServiceSettingsBuilder
- builder for REST service settings- Returns:
- updated builder
-
webContextConfig
Returns the web-contextConfig
node from the provided config.- Parameters:
config
- config to query for web-context- Returns:
Config
node for web-context
-