Skip to content

Commit

Permalink
add javadoc for decodeSafe method (#21207)
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonEbel authored Dec 17, 2024
1 parent f197bbb commit b9a8df3
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@

public interface Codec {

/**
* @param rawMessage
* @return an empty Optional if RawMessage contains payload data that should not be decoded.
* Otherwise, an Optional with a Message that can be processed further.
* @throws org.graylog2.plugin.inputs.failure.InputProcessingException if an error occurs during decoding.
*/
default Optional<Message> decodeSafe(@Nonnull RawMessage rawMessage) {
return Optional.ofNullable(decode(rawMessage));
}
Expand Down

0 comments on commit b9a8df3

Please sign in to comment.