-
public final class ChuckerInterceptor.BuilderAssembles a new ChuckerInterceptor.
-
-
Constructor Summary
Constructors Constructor Description ChuckerInterceptor.Builder(Context context)
-
Method Summary
Modifier and Type Method Description final ChuckerInterceptor.Buildercollector(ChuckerCollector collector)Sets the ChuckerCollector to customize data retention. final ChuckerInterceptor.BuildermaxContentLength(Long length)Sets the maximum length for requests and responses content before their truncation. final ChuckerInterceptor.BuilderredactHeaders(Iterable<String> headerNames)Sets headers that will be redacted if their names match. final ChuckerInterceptor.BuilderredactHeaders(String headerNames)Sets headers that will be redacted if their names match. final ChuckerInterceptor.BuilderalwaysReadResponseBody(Boolean enable)If set to trueChuckerInterceptor will read full content of response bodies even in case of parsing errors or closing the response body without reading it.final ChuckerInterceptor.BuilderaddBodyDecoder(BodyDecoder decoder)Adds a decoder into Chucker's processing pipeline. final ChuckerInterceptor.BuildercreateShortcut(Boolean enable)If set to true, ChuckerInterceptor will create a shortcut for your app to access list of transaction in Chucker.final ChuckerInterceptor.BuilderskipPaths(String paths)Sets a list of String to skip paths. final ChuckerInterceptor.BuilderskipPaths(Regex paths)Sets a list of Regex to skip paths. final ChuckerInterceptor.BuilderskipDomains(String domains)Sets a list of String to skip domains. final ChuckerInterceptor.BuilderskipDomains(Regex domains)Sets a list of Regex to skip domains. final ChuckerInterceptorbuild()Creates a new ChuckerInterceptor instance with values defined in this builder. -
-
Method Detail
-
collector
final ChuckerInterceptor.Builder collector(ChuckerCollector collector)
Sets the ChuckerCollector to customize data retention.
-
maxContentLength
final ChuckerInterceptor.Builder maxContentLength(Long length)
Sets the maximum length for requests and responses content before their truncation.
Warning: setting this value too high may cause unexpected results.
-
redactHeaders
final ChuckerInterceptor.Builder redactHeaders(Iterable<String> headerNames)
Sets headers that will be redacted if their names match. They will be replaced with the
**symbols in the Chucker UI.
-
redactHeaders
final ChuckerInterceptor.Builder redactHeaders(String headerNames)
Sets headers that will be redacted if their names match. They will be replaced with the
**symbols in the Chucker UI.
-
alwaysReadResponseBody
final ChuckerInterceptor.Builder alwaysReadResponseBody(Boolean enable)
If set to
trueChuckerInterceptor will read full content of response bodies even in case of parsing errors or closing the response body without reading it.Warning: enabling this feature may potentially cause different behaviour from the production application.
-
addBodyDecoder
final ChuckerInterceptor.Builder addBodyDecoder(BodyDecoder decoder)
Adds a decoder into Chucker's processing pipeline. Decoders are applied in an order they were added in. Request and response bodies are set to the first non–null value returned by any of the decoders.
-
createShortcut
final ChuckerInterceptor.Builder createShortcut(Boolean enable)
If set to
true, ChuckerInterceptor will create a shortcut for your app to access list of transaction in Chucker.
-
skipPaths
final ChuckerInterceptor.Builder skipPaths(String paths)
-
skipPaths
final ChuckerInterceptor.Builder skipPaths(Regex paths)
Sets a list of Regex to skip paths. When any of the Regex matches a request path, the request will be skipped. Include RegexOption where necessary.
".*(jpg|jpeg|png|gif|webp|svg|bmp|ico)$".toRegex(), // Ignore all image requests ".*iGnOrE.*"toRegex(RegexOption.IGNORE_CASE), // Case insensitive ".*path/to/skip.*".toRegex(), ".*path/ends/with/dev$".toRegex(),
-
skipDomains
final ChuckerInterceptor.Builder skipDomains(String domains)
-
skipDomains
final ChuckerInterceptor.Builder skipDomains(Regex domains)
Sets a list of Regex to skip domains. Domain names are evaluated in lowercase format. When any of the Regex matches a request domain, the request will be skipped. Include RegexOption where necessary.
".*iGnOrE.*"toRegex(RegexOption.IGNORE_CASE), "ignoresubdomain.*".toRegex(), "domainname.*".toRegex(), ".*.dev$".toRegex(),
-
build
final ChuckerInterceptor build()
Creates a new ChuckerInterceptor instance with values defined in this builder.
-
-
-
-