Package io.smallrye.reactive.messaging
Class MessageConverter.IdentityConverter
java.lang.Object
io.smallrye.reactive.messaging.MessageConverter.IdentityConverter
- All Implemented Interfaces:
MessageConverter
,jakarta.enterprise.inject.spi.Prioritized
- Enclosing interface:
- MessageConverter
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.smallrye.reactive.messaging.MessageConverter
MessageConverter.IdentityConverter
-
Field Summary
FieldsFields inherited from interface io.smallrye.reactive.messaging.MessageConverter
CONVERTER_DEFAULT_PRIORITY
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canConvert
(Message<?> in, Type target) Checks whether this instance of converter can convert the given messagein
into aMessage<T>
withT
being the type represented bytarget
.Message<?>
Converts the given messagein
into aMessage<T>
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.smallrye.reactive.messaging.MessageConverter
getPriority
-
Field Details
-
INSTANCE
-
-
Method Details
-
canConvert
Description copied from interface:MessageConverter
Checks whether this instance of converter can convert the given messagein
into aMessage<T>
withT
being the type represented bytarget
. When reactive messaging looks for a converter, it picks the first converter returningtrue
for a given message.- Specified by:
canConvert
in interfaceMessageConverter
- Parameters:
in
- the input message, notnull
target
- the target type, generally the type ingested by a method- Returns:
true
if the conversion is possible,false
otherwise.
-
convert
Description copied from interface:MessageConverter
Converts the given messagein
into aMessage<T>
. This method is only called after a successful call toMessageConverter.canConvert(Message, Type)
with the given target type.- Specified by:
convert
in interfaceMessageConverter
- Parameters:
in
- the input messagetarget
- the target type- Returns:
- the converted message.
-