TypeNaming

reactivemongo.api.bson.TypeNaming
See theTypeNaming companion object
trait TypeNaming extends Class[_] => String

Naming strategy, to map each class to a discriminator value.

import reactivemongo.api.bson.{ MacroConfiguration, TypeNaming }

val cfg1 = MacroConfiguration(typeNaming = TypeNaming.FullName)

val cfg2 = MacroConfiguration(typeNaming = TypeNaming.FullName)

val cfg3 = MacroConfiguration(
 typeNaming = TypeNaming { (cls: Class[_]) =>
   "_" + cls.getSimpleName
 })

Attributes

See also:
Companion:
object
Graph
Supertypes
trait Class[_] => String
class Object
trait Matchable
class Any
Known subtypes
object FullName.type
object SimpleName.type

Members list

Concise view

Value members

Abstract methods

def apply(tpe: Class[_]): String

Returns the name for the given type.

Returns the name for the given type.

import scala.reflect.ClassTag

import reactivemongo.api.bson.TypeNaming

def foo[T](n: TypeNaming)(implicit ct: ClassTag[T]): String =
 n(ct.runtimeClass)

Attributes

Concrete methods

Composes the naming with the given function f, applied on the first result.

Composes the naming with the given function f, applied on the first result.

import reactivemongo.api.bson.TypeNaming

val tpeNaming: TypeNaming =
 TypeNaming.SimpleName.andThen(_.toLowerCase)

Attributes

Inherited methods

def andThen[A](g: String => A): T1 => A

Attributes

Inherited from:
Function1
def compose[A](g: A => Class[_]): A => R

Attributes

Inherited from:
Function1
override def toString(): String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns:

a string representation of the object.

Definition Classes
Function1 -> Any
Inherited from:
Function1