in storehaus-mongodb/src/main/scala/com/twitter/storehaus/mongodb/MongoStore.scala [97:107]
protected def getValue(valueObject: MongoDBObject): Try[Option[V]] =
valueObject.getAs[V](valueName) match {
case None =>
if (valueObject.get(valueName).isEmpty) Return(None)
else Throw(
new ClassCastException(s"Cannot convert ${valueObject.get(valueName)} to ${manifest[V]}"))
case Some(value) =>
if (getManifest.isInstance(value)) Return(Some(value))
else Throw(new ClassCastException(
s"Cannot convert $value of type ${value.getClass} to ${manifest[V]}"))
}