Skip to content

Commit

Permalink
[TH2-4989] Corrected toBuilder interface for ParsedMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita-Smirnov-Exactpro committed Jul 19, 2023
1 parent 260387c commit 78d1c2f
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,9 @@ class ParsedMessage private constructor(
}

//TODO: add override annotation
fun toBuilder(): Builder<Builder<*>> {
return when {
body === DEFAULT_BODY -> FromRawBuilderImpl(bodySupplier).setRawBody(rawBody)
bodySupplier === DEFAULT_BODY_SUPPLIER -> FromMapBuilderImpl().setBody(body)
else -> error("Message can't be convert to builder $this")
}.apply {
fun toBuilder(): FromMapBuilder {
return FromMapBuilderImpl().apply {
setBody(body)
setId(id)
setMetadata(metadata)
setProtocol(protocol)
Expand Down

0 comments on commit 78d1c2f

Please sign in to comment.