Sometimes it is necessary to use Enumerations that are serialized to Ints and others that serialize to Strings
within the same tech.scoundrel.rogue.cc.RCcMeta. It can be obtained by using EnumSerializeValue annotation
See also
EnumAnnotationTest
example:
object EName extendsEnumeration { val v1 = Value("V1"); val v2 = Value("V2") }
@EnumSerializeValue object EValue extendsEnumeration { val v1 = Value("bla1"); val v2 = Value("bla2") }
caseclass C(e:EName.Value, v: EValue.Value)
importimport BsonFormats._ ;import EnumAnnotatedFormats._
implicitval enE = EName
implicitval evE = EValue
val format = BsonFormat[C]
println(format.write(C(EName.v1, EValue.v2)))
Sometimes it is necessary to use Enumerations that are serialized to Ints and others that serialize to Strings within the same tech.scoundrel.rogue.cc.RCcMeta. It can be obtained by using EnumSerializeValue annotation
EnumAnnotationTest example:
will produce
{ "v" : 1, "e" : "V1" }