Interface MongoTypeMapper
- All Superinterfaces:
TypeMapper<org.bson.conversions.Bson>
- All Known Implementing Classes:
DefaultMongoTypeMapper
Mongo-specific
TypeMapper exposing that Documents might contain a type key.- Since:
- 1.0
- Author:
- Oliver Gierke, Christoph Strobl
-
Method Summary
Modifier and TypeMethodDescriptiondefault Class<?> getWriteTargetTypeFor(Class<?> source) Compute the target type for a given source consideringCustomConversions.booleanReturns whether the given key is the type key.voidwriteTypeRestrictions(org.bson.Document result, Set<Class<?>> restrictedTypes) Writes type restrictions to the givenDocument.Methods inherited from interface TypeMapper
readType, readType, writeType, writeType
-
Method Details
-
isTypeKey
-
writeTypeRestrictions
Writes type restrictions to the givenDocument. This usually results in an$in-clause to be generated that restricts the type-key (e.g._class) to be in the set of type aliases for the givenrestrictedTypes.- Parameters:
result- must not be nullrestrictedTypes- must not be null
-
getWriteTargetTypeFor
Compute the target type for a given source consideringCustomConversions.- Parameters:
source- the source type.- Returns:
- never null.
- Since:
- 2.2
-