From 7120cfc4af980a0d9880c11eb690200d2b0dbeca Mon Sep 17 00:00:00 2001 From: Oleg Date: Fri, 13 Oct 2023 14:47:07 +0400 Subject: [PATCH] Add methods for Java binary compatibility --- .../message/impl/rabbitmq/transport/ParsedMessage.kt | 10 +++++++++- .../message/impl/rabbitmq/transport/RawMessage.kt | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/com/exactpro/th2/common/schema/message/impl/rabbitmq/transport/ParsedMessage.kt b/src/main/kotlin/com/exactpro/th2/common/schema/message/impl/rabbitmq/transport/ParsedMessage.kt index f7668425..cf5d9ccb 100644 --- a/src/main/kotlin/com/exactpro/th2/common/schema/message/impl/rabbitmq/transport/ParsedMessage.kt +++ b/src/main/kotlin/com/exactpro/th2/common/schema/message/impl/rabbitmq/transport/ParsedMessage.kt @@ -157,7 +157,15 @@ class ParsedMessage private constructor( companion object { @JvmField - val EMPTY = ParsedMessage(type = "", body = emptyMap()) + val EMPTY: ParsedMessage = ParsedMessage(type = "", body = emptyMap()) + + @Deprecated( + "Please use EMPTY instead. Added for binary compatibility", + level = DeprecationLevel.HIDDEN, + replaceWith = ReplaceWith(expression = "EMPTY") + ) + @JvmStatic + fun getEMPTY(): ParsedMessage = EMPTY /** * We want to be able to identify the default body by reference. diff --git a/src/main/kotlin/com/exactpro/th2/common/schema/message/impl/rabbitmq/transport/RawMessage.kt b/src/main/kotlin/com/exactpro/th2/common/schema/message/impl/rabbitmq/transport/RawMessage.kt index 219ff4f1..0defb486 100644 --- a/src/main/kotlin/com/exactpro/th2/common/schema/message/impl/rabbitmq/transport/RawMessage.kt +++ b/src/main/kotlin/com/exactpro/th2/common/schema/message/impl/rabbitmq/transport/RawMessage.kt @@ -78,7 +78,15 @@ data class RawMessage( companion object { @JvmField - val EMPTY = RawMessage() + val EMPTY: RawMessage = RawMessage() + + @Deprecated( + "Please use EMPTY instead. Added for binary compatibility", + level = DeprecationLevel.HIDDEN, + replaceWith = ReplaceWith(expression = "EMPTY") + ) + @JvmStatic + fun getEMPTY(): RawMessage = EMPTY @JvmStatic fun builder(): Builder = RawMessageBuilderImpl()