Class
OptionalJsonConverter<T>
class OptionalJsonConverter<T>
Namespace: System
Assembly: Raven.Core.dll
Source file: Optional.rvn
Inheritance: Object → JsonConverter → JsonConverter<Optional<T>> → OptionalJsonConverter<T>
Converts Optional values to and from their natural JSON value representation.
Constructors
1 item
OptionalJsonConverter()
Converts `Optional` values to and from their natural JSON value representation.
Properties
2 items
HandleNull: bool
Gets whether the converter handles JSON `null` directly.
Overrides JsonConverter<Optional<T>>.HandleNull
Type: Type
Gets the type being converted by the current converter instance.
Inherited from JsonConverter<Optional<T>>.Type
Methods
9 items
CanConvert(typeToConvert: Type) -> bool
Determines whether the specified type can be converted.
Inherited from JsonConverter<Optional<T>>.CanConvert
Equals(obj: object?) -> bool
Determines whether the specified object is equal to the current object.
Inherited from Object.Equals
GetHashCode() -> int
Serves as the default hash function.
Inherited from Object.GetHashCode
GetType() -> Type
Gets the System.Type of the current instance.
Inherited from Object.GetType
Read(reader: ref Utf8JsonReader, typeToConvert: Type, options: JsonSerializerOptions) -> Optional<T>
Reads `null` as `None` and any other JSON value as `Some`.
Overrides JsonConverter<Optional<T>>.Read
ReadAsPropertyName(reader: ref Utf8JsonReader, typeToConvert: Type, options: JsonSerializerOptions) -> Optional<T>
Reads a dictionary key from a JSON property name.
Inherited from JsonConverter<Optional<T>>.ReadAsPropertyName
ToString() -> string?
Returns a string that represents the current object.
Inherited from Object.ToString
Write(writer: Utf8JsonWriter, value: Optional<T>, options: JsonSerializerOptions) -> ()
Writes `Some` as its contained value and `None` as JSON `null`.
Overrides JsonConverter<Optional<T>>.Write
WriteAsPropertyName(writer: Utf8JsonWriter, value: Optional<T>, options: JsonSerializerOptions) -> ()
Writes a dictionary key as a JSON property name.
Inherited from JsonConverter<Optional<T>>.WriteAsPropertyName
Operators
1 item
Static extension member:
implicit conversion<T>(value: OptionalJsonConverter<T>?) -> Optional<OptionalJsonConverter<T>>
Converts a nullable reference to `Some`, or to `None` when it is `null`.
Extension from OptionalExtensions1<T>.op_Implicit