NullableFormatter<T> class

Namespace: Sirenix.Serialization
Assembly: Sirenix.Serialization
public sealed class NullableFormatter<T> : BaseFormatter<T? >, IFormatter<T? >, IFormatter where T : struct
Formatter for all System.Nullable<T> types.
  • System.Object
  • BaseFormatter<System.Nullable<T>>
  • NullableFormatter<T>

Type Parameters


The type that is nullable.


Creates a new instance of NullableFormatter<T>.
public NullableFormatter()


DeserializeImplementation(ref Nullable<T>, IDataReader)
Provides the actual implementation for deserializing a value of type .
protected override void DeserializeImplementation(ref T? value, IDataReader reader)
System.Nullable<T> value

The uninitialized value to serialize into. This value will have been created earlier using OdinSerializer.BaseFormatter`1.GetUninitializedObject.

Sirenix.Serialization.IDataReader reader

The reader to deserialize with.

SerializeImplementation(ref Nullable<T>, IDataWriter)
Provides the actual implementation for serializing a value of type .
protected override void SerializeImplementation(ref T? value, IDataWriter writer)
System.Nullable<T> value

The value to serialize.

Sirenix.Serialization.IDataWriter writer

The writer to serialize with.

This website is brand new and built with the Odin 2.1 beta in mind. This means you might discover some features such as attribute expressions that are only available in the beta.

You can download the 2.1 beta from here and read the patch-notes here.