from Session
inline fun <M : Message, B : Message.Builder> fromSession(crossinline newBuilder: () -> B, crossinline f: B.(Session) -> M): Function<Session, M>
Content copied to clipboard
fromSession(YourMessage::newBuilder) { session ->
...
build()
}Content copied to clipboard
is mostly equivalent to
{ session ->
YourMessage.newBuilder().apply {
...
}.build()
}Content copied to clipboard