s4nchez
val defaultStack = Filter.NoOp.then(ClientFilters.GZip()) val additionalFilters: List<Filter> = listOf( DebuggingFilters.PrintRequestAndResponse(), ClientFilters.BasicAuth("user", "pass")) // additional after default val combinedFilter1: Filter = additionalFilters.fold(defaultStack) { acc, next -> acc.then(next) } // additional before default val combinedFilter2: Filter = additionalFilters.fold(Filter.NoOp) { acc, next -> acc.then(next) }.then(defaultStack)
David Hamilton
A modern programming language that makes developers happier.