const mixinafBedSheet::ValueEncoders

afBedSheet::ValueEncoders

(Service) - Contribute your ValueEncoder classes to this.

@uses a Configuration of Type:ValueEncoder where Type is what the ValueEncoder, um, encodes!

find

Source

abstract ValueEncoder? find(Type valType)

Finds a ValueEncoder for the given type. Returns null if none found.

toClient

Source

abstract Str toClient(Type valType, Obj? value)

Converts the given value to Str via a contributed ValueEncoder. If no ValueEncoder is found, toStr() is used.

valType is NOT Str#!!! But rather the Type of the Obj that is being converted. Required to ensure the correct ValueEncoder is used, and to convert null to default instances.

toValue

Source

abstract Obj? toValue(Type valType, Str clientValue)

Converts the given clientValue into the given valType via a contributed ValueEncoder. If no ValueEncoder is found the value is coerced.