Class UuidJsonConverter
Namespace: Void.Minecraft.Profiles.Serializers
Assembly: Void.Minecraft.dll
Converts
public class UuidJsonConverter : JsonConverter<Uuid>Inheritance
object ← JsonConverter ← JsonConverter<Uuid> ← UuidJsonConverter
Inherited Members
JsonConverter<Uuid>.CanConvert(Type), JsonConverter<Uuid>.Read(ref Utf8JsonReader, Type, JsonSerializerOptions), JsonConverter<Uuid>.ReadAsPropertyName(ref Utf8JsonReader, Type, JsonSerializerOptions), JsonConverter<Uuid>.Write(Utf8JsonWriter, Uuid, JsonSerializerOptions), JsonConverter<Uuid>.WriteAsPropertyName(Utf8JsonWriter, Uuid, JsonSerializerOptions), JsonConverter<Uuid>.HandleNull, JsonConverter<Uuid>.Type, JsonConverter.CanConvert(Type), JsonConverter.Type, object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()
Methods
Read(ref Utf8JsonReader, Type, JsonSerializerOptions)
Reads a UUID from the current JSON string token.
public override Uuid Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)Parameters
reader Utf8JsonReader
The JSON reader positioned at the UUID string.
typeToConvert Type
The target type requested by the serializer.
options JsonSerializerOptions
The active serializer options.
Returns
The parsed UUID.
Exceptions
The JSON token contains a null string.
The string is not a recognized UUID representation.
ReadAsPropertyName(ref Utf8JsonReader, Type, JsonSerializerOptions)
Reads a UUID encoded as a JSON property name.
public override Uuid ReadAsPropertyName(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)Parameters
reader Utf8JsonReader
The JSON reader positioned at the property name.
typeToConvert Type
The target type requested by the serializer.
options JsonSerializerOptions
The active serializer options.
Returns
The parsed UUID.
Exceptions
The property name is null.
The property name is not a recognized UUID representation.
Write(Utf8JsonWriter, Uuid, JsonSerializerOptions)
Writes a UUID as a JSON string value.
public override void Write(Utf8JsonWriter writer, Uuid value, JsonSerializerOptions options)Parameters
writer Utf8JsonWriter
The destination JSON writer.
value Uuid
The UUID to write.
options JsonSerializerOptions
The active serializer options.
WriteAsPropertyName(Utf8JsonWriter, Uuid, JsonSerializerOptions)
Writes a UUID as a JSON property name.
public override void WriteAsPropertyName(Utf8JsonWriter writer, Uuid value, JsonSerializerOptions options)Parameters
writer Utf8JsonWriter
The destination JSON writer.
value Uuid
The UUID to write.
options JsonSerializerOptions
The active serializer options.