org.springframework.data.mongodb.core.convert
Interface MongoReader<T>
- Type Parameters:
T
- the type of the object to convert from a DBObject
- All Known Subinterfaces:
- MongoConverter
- All Known Implementing Classes:
- AbstractMongoConverter, MappingMongoConverter
public interface MongoReader<T>
A MongoWriter is responsible for converting a native MongoDB DBObject to an object of type T.
- Author:
- Mark Pollack, Thomas Risberg, Oliver Gierke
Method Summary |
|
read(Class<S> clazz,
DBObject dbo)
Ready from the native MongoDB DBObject representation to an instance of the class T. |
read
<S extends T> S read(Class<S> clazz,
DBObject dbo)
- Ready from the native MongoDB DBObject representation to an instance of the class T. The given type has to be the
starting point for marshalling the
DBObject
into it. So in case there's no real valid data inside
DBObject
for the given type, just return an empty instance of the given type.
- Parameters:
clazz
- the type of the return value. Will never be null.dbo
- the DBObject
to convert into a domain object. Might be null.
- Returns:
- the converted object. Might be null.
Copyright © 2011. All Rights Reserved.