final class Reader[T] extends Annotation with StaticAnnotation
Indicates a BSON reader to be used for a specific property, possibly overriding the default one from the implicit scope.
import reactivemongo.api.bson.{ BSONDocument, BSONDouble, BSONString, BSONReader } import reactivemongo.api.bson.Macros, Macros.Annotations.Reader val scoreReader: BSONReader[Double] = BSONReader.collect[Double] { case BSONString(v) => v.toDouble case BSONDouble(b) => b } case class Foo( title: String, @Reader(scoreReader) score: Double) val reader = Macros.reader[Foo] reader.readTry(BSONDocument( "title" -> "Bar", "score" -> "1.23" // accepted by annotated scoreReader )) // Success: Foo(title = "Bar", score = 1.23D)
- Annotations
- @param()
Linear Supertypes
Ordering
- Alphabetic
- By Inheritance
Inherited
- Reader
- StaticAnnotation
- Annotation
- AnyRef
- Any
Implicitly
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
Visibility
- Public
- Protected
Instance Constructors
- new Reader(reader: BSONReader[T])
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- def +(other: String): String
- def ->[B](y: B): (Reader[T], B)
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def ensuring(cond: (Reader[T]) => Boolean, msg: => Any): Reader[T]
- def ensuring(cond: (Reader[T]) => Boolean): Reader[T]
- def ensuring(cond: Boolean, msg: => Any): Reader[T]
- def ensuring(cond: Boolean): Reader[T]
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(that: Any): Boolean
- Definition Classes
- Reader → AnyRef → Any
- Annotations
- @SuppressWarnings()
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def formatted(fmtstr: String): String
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- Reader → AnyRef → Any
- Annotations
- @inline()
- 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()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- val reader: BSONReader[T]
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- 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()
Deprecated Value Members
- def →[B](y: B): (Reader[T], B)
- Implicit
- This member is added by an implicit conversion from Reader[T] toArrowAssoc[Reader[T]] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @deprecated
- Deprecated
(Since version 2.13.0) Use
->
instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.