Class StringMessageSerializer
Serializes a simple string.
Inherited Members
Namespace: Silverback.Messaging.Serialization
Assembly: Silverback.Integration.dll
Syntax
public sealed class StringMessageSerializer : IMessageSerializer, IEquatable<StringMessageSerializer>
Constructors
StringMessageSerializer(MessageEncoding?)
Initializes a new instance of the StringMessageSerializer class.
Declaration
public StringMessageSerializer(MessageEncoding? encoding = null)
Parameters
| Type | Name | Description |
|---|---|---|
| MessageEncoding? | encoding | The message encoding. The default is UTF8. |
Properties
Encoding
Gets the message encoding. The default is UTF8.
Declaration
public MessageEncoding Encoding { get; }
Property Value
| Type | Description |
|---|---|
| MessageEncoding |
Methods
Equals(StringMessageSerializer?)
Serializes a simple string.
Declaration
public bool Equals(StringMessageSerializer? other)
Parameters
| Type | Name | Description |
|---|---|---|
| StringMessageSerializer | other |
Returns
| Type | Description |
|---|---|
| bool |
Equals(object?)
Serializes a simple string.
Declaration
public override bool Equals(object? obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj |
Returns
| Type | Description |
|---|---|
| bool |
Overrides
GetHashCode()
Serializes a simple string.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int |
Overrides
SerializeAsync(object?, MessageHeaderCollection, ProducerEndpoint)
Serializes the specified message object into a byte array.
Declaration
public ValueTask<Stream?> SerializeAsync(object? message, MessageHeaderCollection headers, ProducerEndpoint endpoint)
Parameters
| Type | Name | Description |
|---|---|---|
| object | message | The message object to be serialized. |
| MessageHeaderCollection | headers | The message headers collection. |
| ProducerEndpoint | endpoint | The endpoint. |
Returns
| Type | Description |
|---|---|
| ValueTask<Stream> | A Task<TResult> representing the asynchronous operation. The task result contains the Stream with the serialized message. |