const mixinafMorphia::Converters
afMorphia::Converters
(Service) - Converts Fantom objects to and from their Mongo representation.
Contribute Converter instances to this.
@Contribute { serviceType=Converters# }
static Void contributeConverters(Configuration config) {
config[MyType#] = MyTypeConverter()
}
@uses a Configuration of Type:Converter where Type is what the Converter, um, converts.
- get
@Operator
abstract Converter get(Type type)Returns the
Converterinstance used to convert the given type.- toFantom
abstract Obj? toFantom(Type fantomType, Obj? mongoObj)Converts a Mongo object to the given Fantom type.
mongoObjis nullable so converters can choose whether or not to create empty lists and maps.- toMongo
abstract Obj? toMongo(Type fantomType, Obj? fantomObj)Converts the given Fantom object to its Mongo representation.
fantomTypeis required in casefantomObjis null.fantomObjis nullable so converters can create empty / default objects.