a custom generator for things of type A. the apply method takes a type
parameter that is tighter than A, and acquires a TypeKey for that type,
so it can customize its behavior based on the type requested.
the apply method also takes a Generator as argument, so that it can call
back into to the calling Generator to generate complex values.
example usage:
// always generates a 5-element listval listCustomGenerator = new CustomGenerator[List[Any]] {
def apply[B <:List[_] : TypeKey](generator: Generator): B = {
val eltTypeKey = typeKey[B].typeArgs.head
val eltList = List.fill(5) { generator.generate(eltTypeKey) }
eltList.asInstanceOf[B]
}
}
val generator = new TestDataGenerator(customGeneratorPool = CustomGeneratorPool.empty + listCustomGenerator)
This member is added by an implicit conversion from CustomGenerator[A] to
any2stringadd[CustomGenerator[A]] performed by method any2stringadd in scala.Predef.
This member is added by an implicit conversion from CustomGenerator[A] to
ArrowAssoc[CustomGenerator[A]] performed by method ArrowAssoc in scala.Predef.
This member is added by an implicit conversion from CustomGenerator[A] to
StringFormat[CustomGenerator[A]] performed by method StringFormat in scala.Predef.
This member is added by an implicit conversion from CustomGenerator[A] to
ArrowAssoc[CustomGenerator[A]] performed by method ArrowAssoc in scala.Predef.
a custom generator for things of type
A
. theapply
method takes a type parameter that is tighter thanA
, and acquires a TypeKey for that type, so it can customize its behavior based on the type requested.the apply method also takes a Generator as argument, so that it can call back into to the calling
Generator
to generate complex values.example usage: