Class ResponseMarshaler.Builder
java.lang.Object
com.soklet.ResponseMarshaler.Builder
- Enclosing interface:
ResponseMarshaler
Builder used to construct a standard implementation of
ResponseMarshaler
.
This class is intended for use by a single thread.
- Author:
- Mark Allen
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
static interface
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Constructs a defaultResponseMarshaler
instance.Specifies the default charset to use for encoding character data.contentTooLarge
(ResponseMarshaler.Builder.ContentTooLargeHandler contentTooLargeHandler) corsAllowed
(ResponseMarshaler.Builder.CorsAllowedHandler corsAllowedHandler) corsPreflightAllowed
(ResponseMarshaler.Builder.CorsPreflightAllowedHandler corsPreflightAllowedHandler) corsPreflightRejected
(ResponseMarshaler.Builder.CorsPreflightRejectedHandler corsPreflightRejectedHandler) happyPath
(ResponseMarshaler.Builder.HappyPathHandler happyPathHandler) Specifies a custom "happy path" handler for requests.head
(ResponseMarshaler.Builder.HeadHandler headHandler) methodNotAllowed
(ResponseMarshaler.Builder.MethodNotAllowedHandler methodNotAllowedHandler) notFound
(ResponseMarshaler.Builder.NotFoundHandler notFoundHandler) options
(ResponseMarshaler.Builder.OptionsHandler optionsHandler) postProcessor
(ResponseMarshaler.Builder.PostProcessor postProcessor) Specifies an optional "post-process" hook for any final customization or processing before data goes over the wire.throwable
(ResponseMarshaler.Builder.ThrowableHandler throwableHandler)
-
Method Details
-
charset
Specifies the default charset to use for encoding character data.- Parameters:
charset
- the charset to use for encoding character data- Returns:
- this
Builder
, for chaining
-
happyPath
@Nonnull public ResponseMarshaler.Builder happyPath(@Nullable ResponseMarshaler.Builder.HappyPathHandler happyPathHandler) Specifies a custom "happy path" handler for requests.- Parameters:
happyPathHandler
- an optional "happy path" handler- Returns:
- this
Builder
, for chaining
-
notFound
@Nonnull public ResponseMarshaler.Builder notFound(@Nullable ResponseMarshaler.Builder.NotFoundHandler notFoundHandler) -
methodNotAllowed
@Nonnull public ResponseMarshaler.Builder methodNotAllowed(@Nullable ResponseMarshaler.Builder.MethodNotAllowedHandler methodNotAllowedHandler) -
contentTooLarge
@Nonnull public ResponseMarshaler.Builder contentTooLarge(@Nullable ResponseMarshaler.Builder.ContentTooLargeHandler contentTooLargeHandler) -
options
@Nonnull public ResponseMarshaler.Builder options(@Nullable ResponseMarshaler.Builder.OptionsHandler optionsHandler) -
throwable
@Nonnull public ResponseMarshaler.Builder throwable(@Nullable ResponseMarshaler.Builder.ThrowableHandler throwableHandler) -
head
@Nonnull public ResponseMarshaler.Builder head(@Nullable ResponseMarshaler.Builder.HeadHandler headHandler) -
corsPreflightAllowed
@Nonnull public ResponseMarshaler.Builder corsPreflightAllowed(@Nullable ResponseMarshaler.Builder.CorsPreflightAllowedHandler corsPreflightAllowedHandler) -
corsPreflightRejected
@Nonnull public ResponseMarshaler.Builder corsPreflightRejected(@Nullable ResponseMarshaler.Builder.CorsPreflightRejectedHandler corsPreflightRejectedHandler) -
corsAllowed
@Nonnull public ResponseMarshaler.Builder corsAllowed(@Nullable ResponseMarshaler.Builder.CorsAllowedHandler corsAllowedHandler) -
postProcessor
@Nonnull public ResponseMarshaler.Builder postProcessor(@Nullable ResponseMarshaler.Builder.PostProcessor postProcessor) Specifies an optional "post-process" hook for any final customization or processing before data goes over the wire.- Parameters:
postProcessor
- an optional "post-process" hook- Returns:
- this
Builder
, for chaining
-
build
Constructs a defaultResponseMarshaler
instance.The constructed instance is thread-safe.
- Returns:
- a
ResponseMarshaler
instance
-