Class JsonMarshaller<T>
- Namespace
- Apache.Ignite.Marshalling
- Assembly
- Apache.Ignite.dll
JSON marshaller. Uses JsonSerializer.
public sealed class JsonMarshaller<T> : IMarshaller<T>
Type Parameters
T
Object type.
- Inheritance
-
JsonMarshaller<T>
- Implements
-
IMarshaller<T>
- Inherited Members
Constructors
JsonMarshaller(JsonSerializerOptions?)
Initializes a new instance of the JsonMarshaller<T> class.
public JsonMarshaller(JsonSerializerOptions? options = null)
Parameters
options
JsonSerializerOptionsOptions.
Properties
Options
Gets the options.
public JsonSerializerOptions Options { get; }
Property Value
Methods
Marshal(T, IBufferWriter<byte>)
Marshals (serializes) the specified object into the provided writer.
public void Marshal(T obj, IBufferWriter<byte> writer)
Parameters
obj
TObject. Not null - Ignite handles nulls separately and does not invoke the marshaller.
writer
IBufferWriter<byte>Writer.
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.
Unmarshal(ReadOnlySpan<byte>)
Unmarshals (deserializes) an object from the provided data.
public T Unmarshal(ReadOnlySpan<byte> bytes)
Parameters
bytes
ReadOnlySpan<byte>Serialized data.
Returns
- T
Deserialized object.