Class ContentPreviewerFactoryBuilder
java.lang.Object
com.linecorp.armeria.common.logging.ContentPreviewerFactoryBuilder
A builder which builds a
ContentPreviewerFactory
.-
Method Summary
Modifier and TypeMethodDescriptionSets the specifiedMediaType
s to produce the hex dump preview when the content type of theRequestHeaders
orResponseHeaders
is one of theMediaType
s.Sets the specifiedMediaType
s to produce the hex dump preview when the content type of theRequestHeaders
orResponseHeaders
is one of theMediaType
s.binary
(BiFunction<? super HttpHeaders, ? super ByteBuf, String> producer, MediaType... mediaTypes) Sets the specifiedMediaType
s to produce the preview using the specifiedBiFunction
when the content type of theRequestHeaders
orResponseHeaders
is one of theMediaType
s.binary
(BiFunction<? super HttpHeaders, ? super ByteBuf, String> producer, Iterable<MediaType> mediaTypes) Sets the specifiedMediaType
s to produce the preview using the specifiedBiFunction
when the content type of theRequestHeaders
orResponseHeaders
is one of theMediaType
s.binary
(BiFunction<? super HttpHeaders, ? super ByteBuf, String> producer, BiPredicate<? super RequestContext, ? super HttpHeaders> predicate) Sets the specifiedBiPredicate
to produce the preview using the specifiedBiFunction
when the predicate returnstrue
.binary
(BiPredicate<? super RequestContext, ? super HttpHeaders> predicate) build()
Returns a newly-createdContentPreviewerFactory
based on the properties of this builder.defaultCharset
(Charset defaultCharset) Sets the defaultCharset
used to produce the text preview when a charset is not specified in the"content-type"
header.Sets the specifiedMediaType
s NOT to produce the preview when the content type of theRequestHeaders
orResponseHeaders
is one of theMediaType
s.Sets the specifiedMediaType
s NOT to produce the preview when the content type of theRequestHeaders
orResponseHeaders
is one of theMediaType
s.disable
(BiPredicate<? super RequestContext, ? super HttpHeaders> predicate) Sets the specifiedBiPredicate
NOT to produce the preview when the predicate returnstrue
.maxLength
(int maxLength) Sets the maximum length of the produced preview.Sets the specifiedMediaType
s to produce the text preview when the content type of theRequestHeaders
orResponseHeaders
is one of theMediaType
s.Sets the specifiedMediaType
s to produce the text preview when the content type of theRequestHeaders
orResponseHeaders
is one of theMediaType
s.text
(BiPredicate<? super RequestContext, ? super HttpHeaders> predicate) Sets the specifiedBiPredicate
to produce the text preview when the predicate returnstrue
.
-
Method Details
-
maxLength
Sets the maximum length of the produced preview. If not set, 32 is used by default. -
defaultCharset
Sets the defaultCharset
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.
-
text
Sets the specifiedMediaType
s to produce the text preview when the content type of theRequestHeaders
orResponseHeaders
is one of theMediaType
s. -
text
Sets the specifiedMediaType
s to produce the text preview when the content type of theRequestHeaders
orResponseHeaders
is one of theMediaType
s. -
text
public ContentPreviewerFactoryBuilder text(BiPredicate<? super RequestContext, ? super HttpHeaders> predicate) Sets the specifiedBiPredicate
to produce the text preview when the predicate returnstrue
. -
binary
Sets the specifiedMediaType
s to produce the hex dump preview when the content type of theRequestHeaders
orResponseHeaders
is one of theMediaType
s. -
binary
Sets the specifiedMediaType
s to produce the hex dump preview when the content type of theRequestHeaders
orResponseHeaders
is one of theMediaType
s. -
binary
public ContentPreviewerFactoryBuilder binary(BiFunction<? super HttpHeaders, ? super ByteBuf, String> producer, MediaType... mediaTypes) Sets the specifiedMediaType
s to produce the preview using the specifiedBiFunction
when the content type of theRequestHeaders
orResponseHeaders
is one of theMediaType
s. -
binary
public ContentPreviewerFactoryBuilder binary(BiFunction<? super HttpHeaders, ? super ByteBuf, String> producer, Iterable<MediaType> mediaTypes) Sets the specifiedMediaType
s to produce the preview using the specifiedBiFunction
when the content type of theRequestHeaders
orResponseHeaders
is one of theMediaType
s. -
binary
public ContentPreviewerFactoryBuilder binary(BiPredicate<? super RequestContext, ? super HttpHeaders> predicate) -
binary
public ContentPreviewerFactoryBuilder binary(BiFunction<? super HttpHeaders, ? super ByteBuf, String> producer, BiPredicate<? super RequestContext, ? super HttpHeaders> predicate) Sets the specifiedBiPredicate
to produce the preview using the specifiedBiFunction
when the predicate returnstrue
. -
disable
Sets the specifiedMediaType
s NOT to produce the preview when the content type of theRequestHeaders
orResponseHeaders
is one of theMediaType
s. -
disable
Sets the specifiedMediaType
s NOT to produce the preview when the content type of theRequestHeaders
orResponseHeaders
is one of theMediaType
s. -
disable
public ContentPreviewerFactoryBuilder disable(BiPredicate<? super RequestContext, ? super HttpHeaders> predicate) Sets the specifiedBiPredicate
NOT to produce the preview when the predicate returnstrue
. -
build
Returns a newly-createdContentPreviewerFactory
based on the properties of this builder.
-