Skip to content

Commit

Permalink
Change BaseModel to extend ToXContentObject instead of ToXContent (op…
Browse files Browse the repository at this point in the history
…ensearch-project#173)

Signed-off-by: Mohammad Qureshi <47198598+qreshi@users.noreply.github.com>
  • Loading branch information
qreshi committed May 11, 2022
1 parent 6c4ade1 commit 22ce6ce
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
package org.opensearch.commons.notifications.model

import org.opensearch.common.io.stream.Writeable
import org.opensearch.common.xcontent.ToXContent
import org.opensearch.common.xcontent.ToXContentObject

/**
* interface for representing objects.
*/
interface BaseModel : Writeable, ToXContent
interface BaseModel : Writeable, ToXContentObject
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ data class NotificationEvent(
return try {
XContentHelper.toXContent(this, XContentType.JSON, EMPTY_PARAMS, true).utf8ToString()
} catch (e: IOException) {
log.debug("Failed to convert NotificationEvent to string", e)
super.toString() + " threw " + e.toString()
}
}
Expand Down

0 comments on commit 22ce6ce

Please sign in to comment.