public final class ContentPreviewerFactoryBuilder extends Object
ContentPreviewerFactory.| Modifier and Type | Method and Description |
|---|---|
ContentPreviewerFactoryBuilder |
binary(BiFunction<? super HttpHeaders,? super io.netty.buffer.ByteBuf,String> producer,
BiPredicate<? super RequestContext,? super HttpHeaders> predicate)
Sets the specified
BiPredicate to produce the preview using the specified
BiFunction when the predicate returns true. |
ContentPreviewerFactoryBuilder |
binary(BiFunction<? super HttpHeaders,? super io.netty.buffer.ByteBuf,String> producer,
Iterable<MediaType> mediaTypes)
Sets the specified
MediaTypes to produce the preview using the specified BiFunction
when the content type of the RequestHeaders or ResponseHeaders is one of the
MediaTypes. |
ContentPreviewerFactoryBuilder |
binary(BiFunction<? super HttpHeaders,? super io.netty.buffer.ByteBuf,String> producer,
MediaType... mediaTypes)
Sets the specified
MediaTypes to produce the preview using the specified BiFunction
when the content type of the RequestHeaders or ResponseHeaders is one of the
MediaTypes. |
ContentPreviewerFactoryBuilder |
binary(BiPredicate<? super RequestContext,? super HttpHeaders> predicate)
|
ContentPreviewerFactoryBuilder |
binary(Iterable<MediaType> mediaTypes)
Sets the specified
MediaTypes to produce the
hex dump preview when the content type of the
RequestHeaders or ResponseHeaders is one of the MediaTypes. |
ContentPreviewerFactoryBuilder |
binary(MediaType... mediaTypes)
Sets the specified
MediaTypes to produce the
hex dump preview when the content type of the
RequestHeaders or ResponseHeaders is one of the MediaTypes. |
ContentPreviewerFactory |
build()
Returns a newly-created
ContentPreviewerFactory based on the properties of this builder. |
ContentPreviewerFactoryBuilder |
defaultCharset(Charset defaultCharset)
Sets the default
Charset used to produce the text preview when a charset is not specified in the
"content-type" header. |
ContentPreviewerFactoryBuilder |
disable(BiPredicate<? super RequestContext,? super HttpHeaders> predicate)
Sets the specified
BiPredicate NOT to produce the preview when the predicate
returns true. |
ContentPreviewerFactoryBuilder |
disable(Iterable<MediaType> mediaTypes)
Sets the specified
MediaTypes NOT to produce the preview when the content type of the
RequestHeaders or ResponseHeaders is one of the MediaTypes. |
ContentPreviewerFactoryBuilder |
disable(MediaType... mediaTypes)
Sets the specified
MediaTypes NOT to produce the preview when the content type of the
RequestHeaders or ResponseHeaders is one of the MediaTypes. |
ContentPreviewerFactoryBuilder |
maxLength(int maxLength)
Sets the maximum length of the produced preview.
|
ContentPreviewerFactoryBuilder |
text(BiPredicate<? super RequestContext,? super HttpHeaders> predicate)
Sets the specified
BiPredicate to produce the text preview when the predicate
returns true. |
ContentPreviewerFactoryBuilder |
text(Iterable<MediaType> mediaTypes)
Sets the specified
MediaTypes to produce the text preview when the content type of the
RequestHeaders or ResponseHeaders is one of the MediaTypes. |
ContentPreviewerFactoryBuilder |
text(MediaType... mediaTypes)
Sets the specified
MediaTypes to produce the text preview when the content type of the
RequestHeaders or ResponseHeaders is one of the MediaTypes. |
public ContentPreviewerFactoryBuilder maxLength(int maxLength)
public ContentPreviewerFactoryBuilder defaultCharset(Charset defaultCharset)
Charset used to produce the text preview when a charset is not specified in the
"content-type" header. StandardCharsets.UTF_8 is used by default.
Note that this charset is only for the text preview, not for the binary preview.
public ContentPreviewerFactoryBuilder text(MediaType... mediaTypes)
MediaTypes to produce the text preview when the content type of the
RequestHeaders or ResponseHeaders is one of the MediaTypes.public ContentPreviewerFactoryBuilder text(Iterable<MediaType> mediaTypes)
MediaTypes to produce the text preview when the content type of the
RequestHeaders or ResponseHeaders is one of the MediaTypes.public ContentPreviewerFactoryBuilder text(BiPredicate<? super RequestContext,? super HttpHeaders> predicate)
BiPredicate to produce the text preview when the predicate
returns true.public ContentPreviewerFactoryBuilder binary(MediaType... mediaTypes)
MediaTypes to produce the
hex dump preview when the content type of the
RequestHeaders or ResponseHeaders is one of the MediaTypes.public ContentPreviewerFactoryBuilder binary(Iterable<MediaType> mediaTypes)
MediaTypes to produce the
hex dump preview when the content type of the
RequestHeaders or ResponseHeaders is one of the MediaTypes.public ContentPreviewerFactoryBuilder binary(BiFunction<? super HttpHeaders,? super io.netty.buffer.ByteBuf,String> producer, MediaType... mediaTypes)
MediaTypes to produce the preview using the specified BiFunction
when the content type of the RequestHeaders or ResponseHeaders is one of the
MediaTypes.public ContentPreviewerFactoryBuilder binary(BiFunction<? super HttpHeaders,? super io.netty.buffer.ByteBuf,String> producer, Iterable<MediaType> mediaTypes)
MediaTypes to produce the preview using the specified BiFunction
when the content type of the RequestHeaders or ResponseHeaders is one of the
MediaTypes.public ContentPreviewerFactoryBuilder binary(BiPredicate<? super RequestContext,? super HttpHeaders> predicate)
public ContentPreviewerFactoryBuilder binary(BiFunction<? super HttpHeaders,? super io.netty.buffer.ByteBuf,String> producer, BiPredicate<? super RequestContext,? super HttpHeaders> predicate)
BiPredicate to produce the preview using the specified
BiFunction when the predicate returns true.public ContentPreviewerFactoryBuilder disable(MediaType... mediaTypes)
MediaTypes NOT to produce the preview when the content type of the
RequestHeaders or ResponseHeaders is one of the MediaTypes.public ContentPreviewerFactoryBuilder disable(Iterable<MediaType> mediaTypes)
MediaTypes NOT to produce the preview when the content type of the
RequestHeaders or ResponseHeaders is one of the MediaTypes.public ContentPreviewerFactoryBuilder disable(BiPredicate<? super RequestContext,? super HttpHeaders> predicate)
BiPredicate NOT to produce the preview when the predicate
returns true.public ContentPreviewerFactory build()
ContentPreviewerFactory based on the properties of this builder.Copyright © 2020 LeanCloud. All rights reserved.