Table of Contents

Class SnakeCaseAllCapsEnumMemberJsonConverter

Namespace
Steeltoe.Common.CasingConventions
Assembly
Steeltoe.Common.dll

Converts between pascal-cased enum members and their snake-case-all-caps string representation.

HealthStatus.OutOfService <-> OUT_OF_SERVICE
public sealed class SnakeCaseAllCapsEnumMemberJsonConverter : JsonConverterFactory
Inheritance
SnakeCaseAllCapsEnumMemberJsonConverter
Inherited Members

Methods

CanConvert(Type)

When overridden in a derived class, determines whether the converter instance can convert the specified object type.

public override bool CanConvert(Type typeToConvert)

Parameters

typeToConvert Type

The type of the object to check whether it can be converted by this converter instance.

Returns

bool

true if the instance can convert the specified object type; otherwise, false.

CreateConverter(Type, JsonSerializerOptions)

Creates a converter for a specified type.

public override JsonConverter CreateConverter(Type typeToConvert, JsonSerializerOptions options)

Parameters

typeToConvert Type

The type handled by the converter.

options JsonSerializerOptions

The serialization options to use.

Returns

JsonConverter

A converter for which T is compatible with typeToConvert.