Module io.helidon.webserver.jsonrpc
Package io.helidon.webserver.jsonrpc
Class JsonRpcHandlers.BuilderBase<BUILDER extends JsonRpcHandlers.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends JsonRpcHandlers>
java.lang.Object
io.helidon.webserver.jsonrpc.JsonRpcHandlers.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>
- Direct Known Subclasses:
JsonRpcHandlers.Builder
- Enclosing interface:
JsonRpcHandlers
public abstract static class JsonRpcHandlers.BuilderBase<BUILDER extends JsonRpcHandlers.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends JsonRpcHandlers>
extends Object
implements Prototype.Builder<BUILDER,PROTOTYPE>
Fluent API builder base for
JsonRpcHandlers
.-
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 TypeMethodDescriptionaddExceptionMap
(Map<Class<? extends Throwable>, ? extends JsonRpcExceptionHandler> exceptionMap) Return a map of throwable to exception handlers.addHandlersMap
(Map<String, ? extends JsonRpcHandler> handlersMap) Return a map of method names to handlers.Clear existing value of this property.Get access to the error handler, if registered.errorHandler
(JsonRpcErrorHandler errorHandler) Get access to the error handler, if registered.exception
(Class<? extends Throwable> key, JsonRpcExceptionHandler exception) Return a map of throwable to exception handlers.Map
<Class<? extends Throwable>, JsonRpcExceptionHandler> Return a map of throwable to exception handlers.exceptionMap
(Map<Class<? extends Throwable>, ? extends JsonRpcExceptionHandler> exceptionMap) Return a map of throwable to exception handlers.from
(JsonRpcHandlers prototype) Update this builder from an existing prototype instance.from
(JsonRpcHandlers.BuilderBase<?, ?> builder) Update this builder from an existing prototype builder instance.Return a map of method names to handlers.handlersMap
(Map<String, ? extends JsonRpcHandler> handlersMap) Return a map of method names to handlers.method
(String key, JsonRpcHandler method) Return a map of method names to handlers.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
-
handlersMap
Return a map of method names to handlers. This method replaces all values with the new ones.- Parameters:
handlersMap
- a map of method names to handlers- Returns:
- updated builder instance
- See Also:
-
addHandlersMap
Return a map of method names to handlers. This method keeps existing values, then puts all new values into the map.- Parameters:
handlersMap
- a map of method names to handlers- Returns:
- updated builder instance
- See Also:
-
method
Return a map of method names to handlers. This method adds a new value to the map, or replaces it if the key already exists.- Parameters:
key
- key to add or replacemethod
- new value for the key- Returns:
- updated builder instance
- See Also:
-
clearErrorHandler
Clear existing value of this property.- Returns:
- updated builder instance
- See Also:
-
errorHandler
Get access to the error handler, if registered.- Parameters:
errorHandler
- the error handler ornull
- Returns:
- updated builder instance
- See Also:
-
exceptionMap
public BUILDER exceptionMap(Map<Class<? extends Throwable>, ? extends JsonRpcExceptionHandler> exceptionMap) Return a map of throwable to exception handlers. This method replaces all values with the new ones.- Parameters:
exceptionMap
- a map of method names to handlers- Returns:
- updated builder instance
- See Also:
-
addExceptionMap
public BUILDER addExceptionMap(Map<Class<? extends Throwable>, ? extends JsonRpcExceptionHandler> exceptionMap) Return a map of throwable to exception handlers. This method keeps existing values, then puts all new values into the map.- Parameters:
exceptionMap
- a map of method names to handlers- Returns:
- updated builder instance
- See Also:
-
exception
Return a map of throwable to exception handlers. This method adds a new value to the map, or replaces it if the key already exists.- Parameters:
key
- key to add or replaceexception
- new value for the key- Returns:
- updated builder instance
- See Also:
-
handlersMap
Return a map of method names to handlers.- Returns:
- the handlers map
-
errorHandler
Get access to the error handler, if registered.- Returns:
- the error handler
-
exceptionMap
Return a map of throwable to exception handlers.- Returns:
- the exception map
-
toString
-
preBuildPrototype
protected void preBuildPrototype()Handles providers and decorators. -
validatePrototype
protected void validatePrototype()Validates required properties.
-