51Degrees Pipeline for .NET

FiftyOne.Pipeline.JsonBuilder.Converters.WeightedValueConverter Class Reference

Detailed Description

A JsonConverter that converts IWeightedValue<T> instances into JSON data.

Inheritance diagram for FiftyOne.Pipeline.JsonBuilder.Converters.WeightedValueConverter:

[legend]

Collaboration diagram for FiftyOne.Pipeline.JsonBuilder.Converters.WeightedValueConverter:

[legend]

Public Member Functions

override bool CanConvert (Type objectType)
 Returns true if the converter can convert objects of the supplied type.
override object ReadJson (JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
 Convert the data from the given reader.
override void WriteJson (JsonWriter writer, object value, JsonSerializer serializer)
 Write the given value to JSON.

Properties

override bool CanRead [get]
 If true then this converter can be used for reading as well as writing JSON.

Member Function Documentation

◆ CanConvert()

override bool FiftyOne.Pipeline.JsonBuilder.Converters.WeightedValueConverter.CanConvert ( Type objectType)

Returns true if the converter can convert objects of the supplied type.

Parameters
objectTypeThe type to check against.
Returns
True if the converter can convert the supplied type. False if not.

◆ ReadJson()

override object FiftyOne.Pipeline.JsonBuilder.Converters.WeightedValueConverter.ReadJson ( JsonReader reader,
Type objectType,
object existingValue,
JsonSerializer serializer )

Convert the data from the given reader.

Parameters
readerThe reader to read from.
objectTypeThe type of the object to return.
existingValue??
serializerThe serializer to use when reading the JSON.
Returns
The data object.

◆ WriteJson()

override void FiftyOne.Pipeline.JsonBuilder.Converters.WeightedValueConverter.WriteJson ( JsonWriter writer,
object value,
JsonSerializer serializer )

Write the given value to JSON.

Parameters
writerThe writer to use when writing the output.
valueThe value to be converted to JSON
serializerNot used.
Exceptions
ArgumentNullExceptionThrown if one of the supplied parameters is null.