Trait

emblem.emblematic.traversors.sync

Generator

Related Doc: package sync

Permalink

trait Generator extends AnyRef

recursively generates a data structure by type.

you can generate arbritrary data to your liking by implementing the protected vals and defs in this interface. as of yet, i haven't been able to generate the scaladoc for those protected methods. sorry about that.

Source
Generator.scala
See also

TestDataGenerator for an example usage

Linear Supertypes
Known Subclasses
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Generator
  2. AnyRef
  3. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def boolean: Boolean

    Permalink

    generates a boolean

    generates a boolean

    Attributes
    protected
  2. abstract def char: Char

    Permalink

    generates a char

    generates a char

    Attributes
    protected
  3. abstract def constituentTypeKey[A](union: Union[A])(implicit arg0: TypeKey[A]): TypeKey[_ <: A]

    Permalink

    generates a type key for the union constituent

    generates a type key for the union constituent

    A

    the type of the Union object to traverse

    union

    the union

    returns

    the constituent type key

    Attributes
    protected
  4. abstract def dateTime: DateTime

    Permalink

    generates a date-time

    generates a date-time

    Attributes
    protected
  5. abstract def double: Double

    Permalink

    generates a double

    generates a double

    Attributes
    protected
  6. abstract def float: Float

    Permalink

    generates a float

    generates a float

    Attributes
    protected
  7. abstract def int: Int

    Permalink

    generates an int

    generates an int

    Attributes
    protected
  8. abstract def listSize[A](implicit arg0: TypeKey[A]): Int

    Permalink

    returns the size of the list to be generated.

    returns the size of the list to be generated. a negative return value will result in an empty list.

    A

    the type of the list elements

    Attributes
    protected
  9. abstract def long: Long

    Permalink

    generates a long

    generates a long

    Attributes
    protected
  10. abstract def optionSize[A](implicit arg0: TypeKey[A]): Int

    Permalink

    returns the size of the option to be generated.

    returns the size of the option to be generated. a return value of 0 will generate a None, and a return value of 1 (or anything other than 0) will generate a Some.

    A

    the type of the optional value

    Attributes
    protected
  11. abstract def setSize[A](implicit arg0: TypeKey[A]): Int

    Permalink

    returns the size of the set to be generated.

    returns the size of the set to be generated. a negative return value will result in an empty set.

    A

    the type of the set elements

    Attributes
    protected
  12. abstract def string: String

    Permalink

    generates a string

    generates a string

    Attributes
    protected

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from Generator to any2stringadd[Generator] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (Generator, B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from Generator to ArrowAssoc[Generator] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. val customGeneratorPool: CustomGeneratorPool

    Permalink

    the custom generators to use in the recursive generation

    the custom generators to use in the recursive generation

    Attributes
    protected
  9. val emblematic: Emblematic

    Permalink

    the emblematic types to use in the recursive generation

    the emblematic types to use in the recursive generation

    Attributes
    protected
  10. def ensuring(cond: (Generator) ⇒ Boolean, msg: ⇒ Any): Generator

    Permalink
    Implicit information
    This member is added by an implicit conversion from Generator to Ensuring[Generator] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  11. def ensuring(cond: (Generator) ⇒ Boolean): Generator

    Permalink
    Implicit information
    This member is added by an implicit conversion from Generator to Ensuring[Generator] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  12. def ensuring(cond: Boolean, msg: ⇒ Any): Generator

    Permalink
    Implicit information
    This member is added by an implicit conversion from Generator to Ensuring[Generator] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  13. def ensuring(cond: Boolean): Generator

    Permalink
    Implicit information
    This member is added by an implicit conversion from Generator to Ensuring[Generator] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  14. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  15. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  16. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  17. def formatted(fmtstr: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from Generator to StringFormat[Generator] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  18. def generate[A](implicit arg0: TypeKey[A]): A

    Permalink

    generates data for the specified type A

    generates data for the specified type A

    A

    the type of data to generate

    returns

    the generated data

    Exceptions thrown

    emblem.exceptions.CouldNotGenerateException when we encounter a type in the recursive traversal that we don't know how to generate for

  19. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  20. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  21. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  22. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  23. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  24. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  25. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  26. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  27. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  28. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  29. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. def [B](y: B): (Generator, B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from Generator to ArrowAssoc[Generator] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from Generator to any2stringadd[Generator]

Inherited by implicit conversion StringFormat from Generator to StringFormat[Generator]

Inherited by implicit conversion Ensuring from Generator to Ensuring[Generator]

Inherited by implicit conversion ArrowAssoc from Generator to ArrowAssoc[Generator]

Ungrouped