Class CompositeMessageConverter
[Obsolete("This feature will be removed in the next major version. See https://steeltoe.io/docs/v3/obsolete for details.")]
public class CompositeMessageConverter : ISmartMessageConverter, IMessageConverter, IServiceNameAware
- Inheritance
-
CompositeMessageConverter
- Implements
- Derived
- Inherited Members
Constructors
CompositeMessageConverter(ICollection<IMessageConverter>)
public CompositeMessageConverter(ICollection<IMessageConverter> converters)
Parameters
convertersICollection<IMessageConverter>
Fields
DEFAULT_SERVICE_NAME
public const string DEFAULT_SERVICE_NAME = "CompositeMessageConverter"
Field Value
Properties
Converters
public List<IMessageConverter> Converters { get; }
Property Value
ServiceName
public string ServiceName { get; set; }
Property Value
Methods
FromMessage(IMessage, Type)
Convert the payload of a message to a typed object.
public object FromMessage(IMessage message, Type targetClass)
Parameters
Returns
- object
the result of the conversion
FromMessage(IMessage, Type, object)
Convert the payload of a message to a typed object.
public object FromMessage(IMessage message, Type targetClass, object conversionHint)
Parameters
messageIMessagethe input message
targetClassTypethe target type of the conversion
conversionHintobjectan extra object passed to the converter which may used for handling the conversion
Returns
- object
the result of the conversion
FromMessage<T>(IMessage)
Convert the payload of a message to a typed object.
public T FromMessage<T>(IMessage message)
Parameters
messageIMessagethe input message
Returns
- T
the result of the conversion
Type Parameters
Tthe target type for the conversion
FromMessage<T>(IMessage, object)
Convert the payload of a message to a typed object.
public T FromMessage<T>(IMessage message, object conversionHint)
Parameters
messageIMessagethe input message
conversionHintobjectan extra object passed to the converter which may used for handling the conversion
Returns
- T
the result of the conversion
Type Parameters
Tthe target type for the conversion
ToMessage(object, IMessageHeaders)
Create a message whose payload is the result of converting the given payload object to serialized form.
public IMessage ToMessage(object payload, IMessageHeaders headers)
Parameters
payloadobjectthe object to convert
headersIMessageHeadersoptional headers for the message
Returns
- IMessage
the new messagee or null if converter does not support the payload type
ToMessage(object, IMessageHeaders, object)
Create a message whose payload is the result of converting the given payload object to serialized form.
public IMessage ToMessage(object payload, IMessageHeaders headers, object conversionHint)
Parameters
payloadobjectthe object to convert
headersIMessageHeadersoptional headers for the message
conversionHintobjectan extra object passed to the converter which may used for handling the conversion
Returns
- IMessage
the new messagee or null if converter does not support the payload type
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.