EnumResultConverter
internal class EnumResultConverter<T : Enum<T>>(enumClass: KClass<T>, qualifiedName: QualifiedName, pgConvention: CaseConvention, kotlinConvention: CaseConvention) : ResultConverter<String, T>
Converts a PostgreSQL String representation back into a Kotlin Enum instance during result set deserialization.
Claims a value only when the column's own type is the PostgreSQL enum named by qualifiedName, so an unrelated text column carrying the same label is left to another converter.
Type Parameters
T
The type of the Kotlin enum.
Constructors
Link copied to clipboard
constructor(enumClass: KClass<T>, qualifiedName: QualifiedName, pgConvention: CaseConvention, kotlinConvention: CaseConvention)
Properties
Functions
Link copied to clipboard
open override fun canConvert(sourceClass: KClass<*>, expectedType: KType, sourceType: PgType, context: DeserializationContext): Boolean
Decides whether this converter handles the value at hand. Must return false unless convert can produce an instance of expectedType.