Skip to content

Commit

Permalink
Make TypeSelector public, so it's easier to provide custom TypeSelectors
Browse files Browse the repository at this point in the history
  • Loading branch information
benko-balog committed Oct 18, 2023
1 parent 182b988 commit 17372af
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ package object generic extends Logging {
def mongoTypeSwitch[T: ClassTag, ${implTypeParams}](selectors: List[TypeSelector[_]]): MongoFormat[T] = mongoTypeSwitch[T, ${typeParams}](typeSelector[A${i}]() :: selectors)
</#list>

final class TypeSelector[A: MongoFormat] private[mongo](val typeValue: String, val clazz: Class[_]) {
final class TypeSelector[A: MongoFormat](val typeValue: String, val clazz: Class[_]) {
def read(any: Any): A = fromMongo[A](any)
def write(a: Any): Any = toMongo[A](a.asInstanceOf[A])
}
Expand Down

0 comments on commit 17372af

Please sign in to comment.