public class BsonTypeClassMap
extends java.lang.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 and Description |
---|
BsonTypeClassMap()
Construct an instance with the default mappings.
|
BsonTypeClassMap(java.util.Map<BsonType,java.lang.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 and Description |
---|---|
boolean |
equals(java.lang.Object o) |
java.lang.Class<?> |
get(BsonType bsonType)
Gets the Class that is mapped to the given BSON type.
|
int |
hashCode() |
public BsonTypeClassMap(java.util.Map<BsonType,java.lang.Class<?>> replacementsForDefaults)
replacementsForDefaults
- the replacement mappingspublic BsonTypeClassMap()
public java.lang.Class<?> get(BsonType bsonType)
bsonType
- the BSON typepublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object