Table of Contents

Class NumberToStringConverter

Namespace: CmlLib.Core.Internals
Assembly: CmlLib.Core.dll

public class NumberToStringConverter : JsonConverter<object?>

Inheritance

objectJsonConverterJsonConverter<object?>NumberToStringConverter

Inherited Members

JsonConverter<object?>.CanConvert(Type), JsonConverter<object?>.Read(ref Utf8JsonReader, Type, JsonSerializerOptions), JsonConverter<object?>.Write(Utf8JsonWriter, object?, JsonSerializerOptions), JsonConverter<object?>.ReadAsPropertyName(ref Utf8JsonReader, Type, JsonSerializerOptions), JsonConverter<object?>.WriteAsPropertyName(Utf8JsonWriter, object?, JsonSerializerOptions), JsonConverter<object?>.HandleNull, JsonConverter<object?>.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

CanConvert(Type)

Determines whether the specified type can be converted.

public override bool CanConvert(Type typeToConvert)

Parameters

typeToConvert Type

The type to compare against.

Returns

bool

true if the type can be converted; otherwise, false.

Read(ref Utf8JsonReader, Type, JsonSerializerOptions)

Reads and converts the JSON to type System.Object.

public override object? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)

Parameters

reader Utf8JsonReader

The reader.

typeToConvert Type

The type to convert.

options JsonSerializerOptions

An object that specifies serialization options to use.

Returns

object?

The converted value.

Write(Utf8JsonWriter, object?, JsonSerializerOptions)

Writes a specified value as JSON.

public override void Write(Utf8JsonWriter writer, object? value, JsonSerializerOptions options)

Parameters

writer Utf8JsonWriter

The writer to write to.

value object?

The value to convert to JSON.

options JsonSerializerOptions

An object that specifies serialization options to use.