public class BsonTypeClassMap extends Object
A map from a BSON types to the Class to which it should be decoded. This class is useful if, for example,
you want to change the default decoding of BSON DATE to something besides java.util.Date
.
The default mappings are:
org.bson.Document.class
java.util.List.class
java.util.Date.class
java.lang.Boolean.class
java.lang.Double.class
java.lang.Integer.class
java.lang.Long.class
org.bson.types.Decimal128.class
java.lang.String.class
org.bson.types.Binary.class
org.bson.types.ObjectId.class
org.bson.types.RegularExpression.class
org.bson.types.Symbol.class
org.bson.types.DBPointer.class
org.bson.types.MaxKey.class
org.bson.types.MinKey.class
org.bson.types.Code.class
org.bson.types.CodeWithScope.class
org.bson.types.BSONTimestamp.class
org.bson.types.Undefined.class
Constructor | Description |
---|---|
BsonTypeClassMap() |
Construct an instance with the default mappings.
|
BsonTypeClassMap(Map<BsonType,Class<?>> replacementsForDefaults) |
Construct an instance with the default mapping, but replacing the default mapping with any values contained in the given map.
|
Modifier and Type | Method | Description |
---|---|---|
boolean |
equals(Object o) |
|
Class<?> |
get(BsonType bsonType) |
Gets the Class that is mapped to the given BSON type.
|
int |
hashCode() |
public BsonTypeClassMap(Map<BsonType,Class<?>> replacementsForDefaults)
replacementsForDefaults
- the replacement mappingspublic BsonTypeClassMap()