trait MacroCodec[T] extends Codec[T]
- T
the case class type for the codec
- Since
2.0
- Alphabetic
- By Inheritance
- MacroCodec
- Codec
- Decoder
- Encoder
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract val caseClassesMap: Map[String, Class[_]]
Creates a
Map[String, Class[_]]
mapping the case class name and the type. - abstract val classFieldTypeArgsMap: Map[String, Map[String, List[Class[_]]]]
A nested map of case class name to a Map of the given field names and a list of the field types.
- abstract val classToCaseClassMap: Map[Class[_], Boolean]
Creates a
Map[Class[_], Boolean]
mapping field types to a boolean representing if they are a case class. - abstract val codecRegistry: CodecRegistry
The
CodecRegistry
for use with the codec. - abstract val encoderClass: Class[T]
The case class type for the codec.
- abstract def getInstance(className: String, fieldsData: Map[String, Any]): T
Creates a new instance of the case class with the provided data
Creates a new instance of the case class with the provided data
- className
the name of the class to be instantiated
- fieldsData
the Map of data for the class
- returns
the new instance of the class
- abstract def writeCaseClassData(className: String, writer: BsonWriter, value: T, encoderContext: EncoderContext): Unit
The method that writes the data for the case class
The method that writes the data for the case class
- className
the name of the current case class being written
- writer
the
BsonWriter
- value
the value to the case class
- encoderContext
the
EncoderContext
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- val bsonNull: BsonNull
- Attributes
- protected
- lazy val caseClassesMapInv: Map[Class[_], String]
- val classFieldName: String
The field used to save the class name when saving sealed case classes.
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
- def decode(reader: BsonReader, decoderContext: DecoderContext): T
- Definition Classes
- MacroCodec → Decoder
- def encode(writer: BsonWriter, value: T, encoderContext: EncoderContext): Unit
- Definition Classes
- MacroCodec → Encoder
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- def getClassName(reader: BsonReader, decoderContext: DecoderContext): String
- Attributes
- protected
- def getEncoderClass(): Class[T]
- Definition Classes
- MacroCodec → Encoder
- lazy val hasClassFieldName: Boolean
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- def readArray[V](reader: BsonReader, decoderContext: DecoderContext, clazz: Class[V], typeArgs: List[Class[_]]): V
- Attributes
- protected
- def readDocument[V](reader: BsonReader, decoderContext: DecoderContext, clazz: Class[V], typeArgs: List[Class[_]]): V
- Attributes
- protected
- def readValue[V](reader: BsonReader, decoderContext: DecoderContext, clazz: Class[V], typeArgs: List[Class[_]]): V
- Attributes
- protected
- val registry: CodecRegistry
- Attributes
- protected
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- def writeClassFieldName(writer: BsonWriter, className: String, encoderContext: EncoderContext): Unit
- Attributes
- protected
- def writeFieldValue[V](fieldName: String, writer: BsonWriter, value: V, encoderContext: EncoderContext): Unit
- Attributes
- protected
- def writeValue[V](writer: BsonWriter, value: V, encoderContext: EncoderContext): Unit
- Attributes
- protected
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
This is the documentation for the MongoDB Scala driver.
Driver structure
The mongodb scala driver.
To get started you need a MongoClient instance, either from a connection string or via a org.mongodb.scala.MongoClientSettings.
Notable packages include: