Skip to content

Commit

Permalink
Add methods for Java binary compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
OptimumCode committed Oct 13, 2023
1 parent bcb07ce commit 7120cfc
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 7120cfc

Please sign in to comment.