AttributeConverter
interface in package klyn.data.mapping

    public interface AttributeConverter<T, TProvider>:

AttributeConverter

Converts one mapped Klyn value to and from a provider value.

Implementations are statically typed and must not rely on reflection during ordinary entity materialization or persistence.

Example

    @Converter(autoApply=true)
    public class EmailConverter implements AttributeConverter<Email, String>:

    public toProvider(value as Email) as String:
    return value.toString()

    public fromProvider(value as String) as Email:
    return Email(value)

Methods

Modifier and Type | Member | Description
--- | --- | ---
public | fromProvider `fromProvider(value as TProvider) as T` | Converts a provider value to its entity property representation.
public | toProvider `toProvider(value as T) as TProvider` | Converts an entity property value to its provider representation.